TOOL · FREE · RUNS IN YOUR BROWSERallwpcare.com/tools/wordpress-cron-job-generator/
Free tool

WordPress cron job generator

WordPress's built-in scheduler only runs when someone visits. Pick how your server will run it instead, and get the cron line, the wp-config.php line and the steps in the right order.

Everything is worked out in your browser as you type. Your address and paths are never sent anywhere or stored. The tool does not change your site: you copy the lines yourself.

1. How will the server run it?
2. How often?

5 minutes is a common choice and what our guide suggests: a scheduled post goes out at most about 5 minutes late. It is not a WordPress rule. WordPress will not start a second run within 60 seconds of the last one, so running more often than once a minute gains nothing. Some shared hosts only allow runs every 15 minutes or less often: if yours does, pick the shortest your host allows.

3. Your details

As you type it in your browser. If WordPress lives in a folder, add it: https://example.com/blog

If you are not that user, the tool shows a command that opens that user's crontab.

Your lines

Not ready yet. Enter your site address, for example https://example.com.

Fill in the boxes on the left. Everything is worked out on this page as you type, and nothing leaves your browser.

What does this cron line mean?

Paste the five time fields of a cron line (without the command after them) to read it in plain words and see when it runs next. It works out the times in this page. What you type is not sent anywhere.

Try:

How it works

What it does

It builds one line for your server's cron (or the Windows Task Scheduler) that makes WordPress run its due tasks every few minutes, whether or not anyone visits. The WordPress handbook describes the same approach: set up your system's task scheduler to request wp-cron.php, then add define( 'DISABLE_WP_CRON', true ); to wp-config.php.

The safe order

  1. Test the command by hand once.
  2. Add the cron job.
  3. Wait a few runs and check that tasks are not piling up.
  4. Only then add the line to wp-config.php.

If you add the wp-config.php line first and the cron job does not work, nothing runs scheduled tasks: posts do not publish and update checks stop. To undo, remove the line from wp-config.php and delete the cron job.

Limits to know about

  • Your host decides. Some shared hosts only allow cron jobs every 15 minutes or less often, or limit how many you can have.
  • The wget and curl methods use the web. A cache, a CDN, a firewall, or a password on the whole site (basic auth) can block the request. So can a rule in .htaccess or in your Nginx config that denies wp-cron.php. WP-CLI and the PHP method do not go through the web server.
  • Time zones. Cron uses the server's clock. The helper below shows times in your browser's time zone.
  • Windows. The Windows steps follow the WordPress handbook's PowerShell command.

Keeping an eye on scheduled tasks

Once this is set up, WellTend Health Monitor can watch the result: it reports overdue scheduled tasks and tells you when WP-Cron is switched off. It is a check, not a replacement for the cron job.

FAQ

Why do my scheduled posts run late or show Missed schedule?

WordPress's built-in scheduler, WP-Cron, only starts when someone visits your site. Its own file says so: it is triggered when the site receives a visit. On a quiet site, or if the site cannot call itself, tasks wait. A real server cron job starts them on time. Our missed schedule guide shows how to find the cause.

Why set DISABLE_WP_CRON at all, if the server cron job already works?

The WordPress handbook says WP-Cron would still run on each page load, which is no longer needed and uses extra server resources. DISABLE_WP_CRON stops that. Do it last, after you have checked the server cron job works.

Does DISABLE_WP_CRON stop wp-cron.php from working?

No. The comment at the top of wp-cron.php says that setting the constant and calling the file directly are separate things, and that calling the file does not rely on the constant. So a server cron job that requests wp-cron.php, or runs it with PHP, keeps working with the constant set.

Which method should I pick?

WP-CLI if your host gives you SSH and WP-CLI: it does not go through the web server, so a cache, firewall or password prompt in front of the site cannot block it. If you do not have WP-CLI, curl or wget are simple and work on most hosts. If you only have a cron screen in a control panel, use the "My host has a cron screen" choice. Running the file with PHP is another option when you know the path to your site.

How often should it run?

Every 5 minutes is a common choice and what our guide suggests, so a scheduled post goes out at most about 5 minutes late. It is not a WordPress rule. The WordPress handbook only says to pick the interval you need. WordPress also keeps a lock (WP_CRON_LOCK_TIMEOUT, 60 seconds by default) so it does not start a second run within a minute, so every minute is the fastest that makes sense. Some shared hosts do not allow runs more often than every 15 minutes: check with your host.

What do WP_CRON_LOCK_TIMEOUT and ALTERNATE_WP_CRON do?

WP_CRON_LOCK_TIMEOUT is how many seconds WordPress waits before it will start WP-Cron again. WordPress sets it to 60 if you do not. ALTERNATE_WP_CRON is for hosts where a site cannot call itself: when it is true, WordPress sends the visitor's browser to the same page address with doing_wp_cron added, instead of calling itself in the background. It only does this for normal page requests (GET). You do not need it with a server cron job, and this tool does not touch either one.

Is it safe to put my site address and folder path in a command?

This tool only accepts a short list of safe characters in the address and the paths, and then puts each value in quotes as well. Anything with a space, quote, semicolon, dollar sign, backtick, line break or similar is refused with a message. A percent sign in a crontab means a new line, so if one is allowed through, it is written as \%. You still need to read the line before you add it.

What about a multisite network?

With WP-CLI, the handbook for global parameters says --url is how you say which site of a network you mean. Tick the multisite box and the tool adds it for the address you typed. Add one line for each site that needs its own scheduled tasks.

The wget or curl line does nothing. Why?

Something is probably blocking the request: a rule in .htaccess or Nginx that denies wp-cron.php, a cache or CDN, a firewall, or a password prompt (basic auth) in front of the whole site. Run the command by hand and check echo $?. WP-CLI and the PHP method skip the web server, so they are not affected. The .htaccess generator and the Nginx config generator show what a normal setup looks like.