Dec 22, 2025
Jordana A.
5min Read
Cron is a UNIX utility that allows users to run scheduled tasks on a web server. WordPress has its own cron system called WP-Cron that simulates the UNIX cron system to automate update checkups, scheduled post publishing, and other repetitive tasks.
If you’re a WordPress user, knowing how to schedule WP cron events will make your administrative tasks easier.
This article will cover setting up and managing the WordPress cron system with a plugin and WP-CLI. You will also learn the advantages and disadvantages of using WordPress cron and how it differs from UNIX’s cron job.
Download all-in-one WordPress cheat sheet
WordPress cron job is a system that simulates the UNIX cron system to automate task scheduling at custom time intervals. It allows WordPress users to perform time-based tasks on page load, such as publishing schedule posts and checking for updates.
The WP-Cron system is easy to set up because, unlike the UNIX cron job, it doesn’t require knowledge of UNIX commands. Various WordPress cron job plugins come with features that simplify the setup and management process, making the system accessible even for beginners.
By allowing you to schedule repetitive tasks at a custom time interval, you can save time and focus on other essential tasks. Additionally, this system ensures you don’t lose any data if the scheduled tasks fail to run on time — a feat that the UNIX cron job cannot do.
Unfortunately, WP-Cron only runs when a user visits your website. Low-traffic WordPress sites will skip some jobs if no one triggers a page load, causing a pending cache buildup and harming the site’s load time and performance.
Driving traffic to your site won’t solve this issue. In fact, high-traffic sites that use cron jobs are prone to race conditions and long-running processes. Race conditions happen when multiple visits occur at the same time, triggering WP-Cron to execute the same task simultaneously. This builds up a queue of jobs, resulting in slow performance.
The easiest way to set up and manage WordPress cron jobs involves using a cron job plugin. In this tutorial, we will use WP Crontrol as it’s free and has all the necessary features. Feel free to use other plugins that suit your preferences.
First, install and activate the WordPress plugin for managing cron jobs by following these steps:
To see all the cron jobs that are running on your WordPress site, go to Tools → Cron Events from your dashboard.
Important! Don’t delete any default WordPress cron jobs (they have the wp prefix). Doing so will disrupt the site’s core functionality.
Now that you can control WordPress cron jobs, you can start managing them. Here’s how to add a new cron event:
add_action( 'hostinger_custom_cron', 'hostinger_custom_cron_func' );
function hostinger_custom_cron_func() {
wp_mail( 'you@example.com', 'Automatic email', 'Automatic scheduled email from WordPress to test cron');
}This example uses the wp_mail() function which prompts WordPress to send an email when the cron event runs. Don’t forget to change the placeholder with an actual email address.
The plugin provides four standard time intervals to choose from, but it still allows users to create custom intervals. Follow these steps to add a new cron schedule:
Now that we have a custom interval, let’s use it with the custom cron. Here’s how to modify an existing cron event:
Another way to set up WordPress cron jobs involves using WP-CLI. This tool lets you manage the site via a command-line interface.
Hostinger’s Managed WordPress Hosting plans come with WP-CLI pre-installed. Therefore, you’ll only need to connect to your hosting account using Putty SSH.

To access the existing cron events, enter this command in the terminal:
wp cron event list
The following command will display the other commands you can use with WP-CLI:
wp help
WordPress creates and stores the WP-Cron script inside the wp-cron.php file. While it allows your WordPress website to have cron jobs running regardless of the OS, this file isn’t immune to attacks and may conflict with caching plugins. The use of real cron jobs can eliminate the constant file execution.
Before setting up real cron jobs, you’ll need to disable the default WordPress cron. To disable WP_CRON, add this code snippet to the wp-config.php file above the “/* That’s all, stop editing! Happy blogging. */” line:
define( 'DISABLE_WP_CRON', true );
The next step is to set up a real cron job to schedule WordPress core tasks. The process may vary depending on your hosting provider or service. If you’re a Hostinger user, follow this tutorial:
wget -O /dev/null -o /dev/null https://yoursite.com/wp-cron.php?doing_wp_cron
Don’t forget to change the placeholder with your website’s actual URL.
The WordPress cron job makes it convenient to schedule tasks at custom time intervals. While WP-Cron has some disadvantages, knowing how to use this utility will allow you to perform administrative tasks more efficiently.
We hope this article has helped you understand the functionality of the WordPress cron job and how to set it up using a plugin and WP-CLI. Good luck.
If you’re looking to optimize your WordPress site’s performance even further, we recommend using high-quality WordPress hosting.
How to Create WordPress Custom Widgets
How to Become a WordPress Developer
Guide to WordPress Page Template
How to Create a WordPress Custom Post Type
WordPress Template Hierarchy Guide
WP-Cron is a web-based system that simulates the UNIX cron system. WP-Cron events are triggered on page load whereas the real cron runs every minute.
WP-Cron works perfectly for its purpose, which is to run WordPress core tasks. However, using it for executing additional tasks can harm your site’s load speed. For this reason, we recommend using real cron jobs for better performance.
If you have unused cron jobs, the easiest solution would be to delete them. Alternatively, modify the time interval as needed.
Run this command to delete cron jobs that use a specific hook. This method is ideal for removing obsolete cron jobs.$ wp cron event delete hook_name
Cron jobs in WordPress can be found in the wp-config.php file or by using a plugin such as WP Crontrol or Advanced Cron Manager.
To run a cron job in WordPress, you can use the wp_schedule_event() function in your theme’s functions.php file or use a plugin such as WP Crontrol or Advanced Cron Manager to set up and manage cron jobs.
Comments
March 29 2022
Hi. How do i create a real cron job with multisite ? and how do i set that up in hpanel?
April 06 2022
Hi Rickard! You can find how to use real cron jobs over here and how to set them up on hPanel over here :)
April 08 2022
Hello, why this error? thank you screen: https://gyazo.com/2c4ffb5dd19718efc57ab77d01cc27f3
April 12 2022
Hi there! It looks like you're trying to create a custom cron (judging by the URL), but you've chosen the PHP method. Make sure to switch to custom method instead :) If you're still having trouble, don't hesitate to drop our Customer Success team a message!
June 20 2022
Hi there, I am having a problem with your custom cronjob definition. The code line is not accepted in the Hostinger cron Job definition, because of the use of special characters. What is the workaround for this ?
July 01 2022
Hey! If your Cron Job has special characters in it, there's no need to worry, as you can still have it running! You can check out this article to learn how to setup Cron Jobs with special characters ?
July 13 2023
define( 'DISABLE_WP_CRON', true ); column at the end which indicates its end is missing in the line, please add it
July 14 2023
Hello, nice catch, fixed!
July 14 2023
Hello, thank you, fixed!