Tips and Tricks Latest Post
Tips and Tricks Latest Post |
How to View and Control WordPress Cron Jobs Posted: 15 Oct 2019 10:55 PM PDT What is a Cron Job?Cron Jobs are basically scheduled tasks that are created automatically by WordPress or a WordPress Plugin that you have activated on your website. They are similar to an alarm clock that goes off regularly to trigger an automative response. Before we delve into explaining how you can view and control Cron Jobs that are running on your WordPress website, for those new to this term it’s best we first explain what a ‘Cron Job’ actually is. In short, the term Cron Job refers to the list of schedules set at intervals that are undertaken each and every day on a website. A ‘Cron Job’ is always a repetitive task that is run at set duration apart. For the most part, a Cron Job is ran once in a 24 hour period although some occur more frequently (as needed). Many WordPress plugins, especially those that trigger emails to be sent out will automatically configure Cron Jobs when you click the install and activate buttons. You will generally never need to worry about when the Cron Job will occur unless you run into an issue. While we will discuss how to view and delete ‘Cron Jobs’ on your WordPress website later on in this tutorial, for the most part, you will have no need to delve into ‘Cron Jobs’ unless the job has duplicated itself or isn’t running at all. To be more specific, some ‘Cron Jobs’ undertaken on a website that you may need to troubleshoot include:
When you view the list of Cron Jobs running on your website, at first you may be taken back if you are not a developer. Every ‘Cron Job’ has a script which is the task to be executed, a command that executes the script and an action of the script. No ‘Cron Job’ should run more often than every 15 minutes unless you have a dedicated server. In terms of when a Cron Job runs, they can be set to run at the following periods apart:
While many plugins do create a Cron Job, having excessive amounts of ‘Cron Jobs’ running can slow down your server. It is for this reason that we always advice limiting the amount of plugins on your website to those that you need rather than want. Why Would I Need to View my Cron Jobs?While many users of WordPress will never have a need to view their Cron Jobs, we’ve had a handful of customers who have needed to look at this. So we’ve decided to create a step by step tutorial to help those that run into a Cron Job related problem either with one of our plugins or another WordPress plugin. If you have a fresh WordPress install and you are yet to install a plugin you may think that there are no ‘Cron Jobs’ running. This is incorrect as WordPress runs a number of Crons such as one that ensures updates are displayed, old trashed comments are deleted and scheduled posts are published. For some WordPress users, they may find that a specific set of ‘Cron Jobs’ ran by a plugin are slowing down their website, or they may presume this is the case. Viewing the ‘Cron Jobs’ will allow the WordPress user to delete the plugin and find an alternative solution or delete off ‘Cron Jobs’ that they do not require on their website. Other WordPress users may find that an email is being sent twice in a 24 hour period whereas it should only be sent once. This is generally caused by a duplicate ‘Cron Job’ that can be fixed by removing one of the jobs from the task list. Errors that Relate to WordPress Cron JobsIf you have run into an error on your WordPress site that is related to an automated regular task, a Cron Job could be at fault. Perhaps the Cron Job was never created properly on the installation of a plugin, or worse, perhaps a duplicate was created. Some of the following errors may occur if there are problems with Cron Jobs on your website:
Viewing and Controlling Cron Jobs Video TutorialHow Can I View and Edit my Cron Jobs?The easiest way to view your Cron Jobs and alter or delete a job is through the use of a well-known plugin: WP Crontrol. It is a well developed Cron Job plugin currently available from WordPress.org repository. If you do not find this plugin to be the right fit, there are a number of other free Cron Job control related plugins available. When you install WP Crontrol, or a similar plugin for WordPress, you will be able to view all scheduled ‘Cron Jobs’. The hook name of each ‘Cron Job’ gives you an insight into what that ‘Cron Job’ is designed to do. In the next column, the time at which the next ‘Cron Job’ will occur and the time interval between each are displayed. Each ‘Cron Job’ can be edited or deleted which allows you to remove a duplicate if you have ran into this type of issue. While deleting a duplicate ‘Cron Job’ for a plugin you have installed is entirely fine, be sure to never delete a standard WordPress ‘Cron Job’ as this will cause failures with basic WordPress functionality and actions.
The ‘Hook Name’ of the Cron Job generally gives insight into which plugin has created it. Those starting with ‘wp’ are generally created by WordPress rather than a plugin. It is advised you do not delete these Cron Jobs. While WP Crontrol is a useful plugin if you need to delete a duplicate action or an action you don’t necessary need, you can also do the following using this free WordPress plugin:
The post How to View and Control WordPress Cron Jobs appeared first on Tips and Tricks HQ. |
You are subscribed to email updates from Tips and Tricks HQ. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments: