WordPress Cron Jobs | How To Add, View, And Control Them? Best of 2023

Daily posts and updates of your website stay you connected with your viewers. And to keep the connection continued you need to show activities on your website even when you are not there. As the articles posted by the admin of a WordPress site are called posts.

When we deal with the global audience we must take care of their daily routine. According to Coordinated Universal Time, there is an almost 24-time zone in the World. In some cases, the day-night we share are not the same.

So, when you are dealing with people who do not belong to the same time zone. You need to post & update on your website according to their time zone.

Scheduling is an art of planning which acts as a filter against the distraction of a busy life. In the World of websites, WordPress is the largest using CMS and WordPress Cron jobs are played a vital role to schedule your tasks.

Content Management System (CMS) is a system which allows users to easily create, edit, organize and publishing content. It is a tool or software that allows you to create a website without having any technical knowledge.  

If you want a scheduling feature in action using WordPress Cron plugins. Here, we’re going to illustrate to you how to view and control WordPress Cron Jobs for perfect scheduling.

Where, A plugin is defined as a type of software that contains a group of functions that can be added to a WordPress website. They are used to provide additional functionality to your application.

What is WordPress Cron?

Cron is a technique that is used for commands to run on scheduled time or at regular intervals. Sometimes WordPress Crons are used to maintain the server and run scheduled tasks. Where Web Server is a software which receives your request for accessing a web page.

It runs only a couple of security checks on your HTTP request and takes you to the web page. For example, deleting old comments from trash, checking for updates, etc.

In other words, Cron is a time-based job scheduler that is originally built for Linux or Unix-based system (OS X included). A Cron runs the scheduled tasks on the webserver. WordPress comes with its own built-in Cron which allows it to perform scheduled tasks like publishing scheduled posts, checking for updates, etc.

WordPress plugins also use Crons to accomplish the tasks specified by you. For example, your WordPress backup plugin can use WordPress Cron to create check new updates automatically on a given schedule.

WordPress backup allows you to save your WordPress site data in case of any hacking & crashing attempts. It restores your data normally in the event of any problem.

How WordPress Cron works

A typical Unix Cron system runs in an order of “A time tied to action occurs” and “Cron runs the action tied to that time”.

While WordPress Cron works a little differently like it checks each Cron event to see whether the scheduled time has passed or not. Once the scheduled time for that event has passed, then WordPress Cron can execute any action tied to that event.

As previously said, the Cron or scheduling feature is added by plugins or by codes. Moving on the same, first, we discuss WordPress Cron plugin.

Top WordPress Cron plugins

1. WP Control plugin

WP Control plugin
WP – Crontrol – Cron Jobs

WordPress offers you a WP Control plugin to view and control Cron jobs in WordPress site. As an admin, you can view all Cron events along with their arguments, recurrence, callback functions. You can also edit, delete and immediately run any Cron events.

WP Control plugin allows you to delete bulk Cron events and edit, add custom Cron schedules. If your Cron system doesn’t appear to be working then your admin screen will show you a warning message.

The WordPress Admin Screen provides access to the control features of your WordPress installation. Each Administration Screen is presented in the sections, the toolbar (and header), the main navigation, the work area, and the footer.

To start with plugin firstly, install the WP Control plugin and then activate it. For more info, read our guide on how to install a plugin in WordPress. After activation visits the settings of your WordPress dashboard.

How to add a New Cron schedule?

Here, you’ll notice that the plugin adds an additional default schedule. you can also add your new Cron schedule by filling the Internal name, Interval, Display name.

add schedule
WP-Cron Schedules – Cron Jobs

Now, click on the “Add Cron Schedule” button to save your new Cron schedule.

How to add a new Cron event?

WP Control Plugin makes it easy to add your own Cron jobs to WordPress. After adding a new schedule, you can add a new Cron event. Just follow the steps given below.

  • Simply go to the Tools>>Cron Events Page and scroll down to the ‘Add Cron Event’ tab.
Tools>>Cron
Add Cron Event – Cron Jobs
  • It’ll ask you for a hook name for your event. The hook names cannot contain spaces or special characters.
  • If the function requires arguments that you want to execute, then you can provide those arguments. Next time when to run the Cron, you have to tell WordPress.
  • You can enter ‘now’ that will trigger Cron immediately, ‘tomorrow’, ‘+2 days’, or ’25 -02-2020 12:34:00′.
  • Then, you need to choose a schedule you can choose hourly, twice daily, daily or weekly. Also, you can create a non-repetitive event.
  • Once you’re done, then click the Add Cron Event button to store your changes.
  • You will see that your event will now appear in the event list.

Currently, it does nothing when the event is triggered until you give a command. For this, you’ll need a corresponding action hook somewhere in your code. Where trigger is defined when and where the tags is executed. A tag in WordPress is one of the default tools one can use to categorize their WordPress posts.

if ( ! wp_next_scheduled( ‘wpb_custom_cron’ ) ) {

 

wp_schedule_event( time(), ‘hourly’, ‘my_task_hook’ );

}add_action( ‘wpb_custom_cron’, ‘wpb_custom_cron_func’ );function wpb_custom_cron_func() {

wp_mail( ‘[email protected]’, ‘Automatic email’, ‘Automatic scheduled email from WordPress to test cron’);

}

  • Remember that, don’t forget to use your own email address.
  • This function sends you a test email when the Cron is running. Now you can scroll up the page and test it by clicking the ‘Run Now’ link next to your event.

Sometimes, the irresponsible use of WordPress Cron by the plugin can slow down your WordPress site. Specifically, if you are on shared hosting.

If a plugin frequently performs resource-intensive works, you need to identify and fix the problem.

Now, move on to know the control of WordPress Crons.

How to view and control the WordPress Cron Jobs system?

Let’s see how to view and control your WordPress Crons with the WP Control plugin.

  • First, go to the dashboard then click on Tool>>Cron Events page to control Cron settings.
View and Control WordPress Cron Jobs
WP-Cron Events – Cron Jobs
  • Now, you’ll see the events schedule list that runs on your site by using the WordPress Cron system.
  • In the first column, you will see the name of the hook that runs the Cron. Usually, Hook names give you a hint about what this particular event does. The mostly default WordPress hook starts with a wp_ prefix such as wp_update_themes, wp_update_plugins, etc.
  • However, your WordPress plugins can or cannot be used their own prefixes for their hooks. For example, Yoast SEO uses wpseo_ prefix.
  • Also, you will see that when a Cron will run next, and the time interval between the next run.
  • The last column in the list permits you to delete, edit, or run an event.

Important Note: Be very careful never to delete the default WordPress Cron event.

Now suppose that you see a Cron event created by a WordPress plugin that quite resources intensive.

  • Then, you should check the settings of the plugin to see if there is an option to control it from there. If not, you can click on the ‘Edit’ link to change it that is next to the Cron event.
View and Control WordPress Cron Jobs
Edit – Cron Jobs
  • To manage the event, you need to click on the “Edit” button. By clicking the edit button it’ll open the “Modify Cron Event” tab below.
  • Now, here you can change how often you want to run the event.
View and Control WordPress Cron Jobs
Modify Cron Event – Cron Jobs
  • Once you have done, click the Save Changes button to save your settings.

2. Advanced Cron Manager – debug & control

Advanced Cron Manager plugin has a rating of 5 stars with more than ten thousand active installations. The plugin supports all WordPress versions. And compatible with many themes.

The plugin helps you to manage events, allow to see registered events, manually execute any events and schedule events.

Advanced Cron Manager plugin allows you to copy and paste PHP implementation or each and every event. It also gives the advantage of bulk integration. On blocking the WP Cron spawning and get step instruction to setup server Scheduler. You need to enable Javascript to edit accordingly schedule.

Pro version of the plugin includes Cron Logger, Error catcher, performance stats, and debug tool.

3. WP-Cron Control

WP-Cron Control plugin has a rating of 4.5 stars and more than nine thousand active installations. Compatible with the maximum number of themes and support almost all versions of WordPress.

The plugin is perfect for those sites that either doesn’t get enough comments that ensure a regular execution of wp-corn or the wp-corn is not properly controlled by the regular method and causing repeated execution of Wp-corn at the same time. WP-Cron Control also helps in posts that missed their schedule.

Conclusion

Scheduling posts always keeps you a step forward from others. It shows that your site is still in action even you are not able to reach the admin panel. WordPress Crons jobs specifically work for the scheduling process of your website.

The blog is an effort to summarize the WordPress Cron jobs and how to set up them properly. You may take time to understand, but once you understand then you are able to control WordPress Cron jobs of your site.

Hope! This post will help you. If you like the content please like and share it with others also. Share your views in the comment section. We love to hear from you.

Still, you are facing any query related to this guide, you can call us on our Toll-Free no ++1-888-738-0846. Our WordPress Support team is always there to help you.

That’s all, thanks!


Leave a Reply