How to Replace WordPress Cron With A Real Cron Job

wpcron-missed-scheduleWe are all too familiar with the “Missed Schedule” status, aren’t we? I am sure it is very frustrating to see that all your scheduled posts went MIA.

WordPress comes with its own cron job that allows you to schedule your posts and events. However, in many situations, the WP-Cron is not working well and leads to posts missed their publication schedule and/or scheduled events not executed.

To understand why this happen, we need to know that the WP-Cron is not a real cron job. It is in fact a virtual cron that only works when a page is loaded. In short, when a page is requested on the frontend/backend, WordPress will first load WP-Cron, follow by the necessary page to display to your reader. The loaded WP-Cron will then check the database to see if there is any thing that needs to be done.

Reasons for WP-Cron to fail could be due to:

  • DNS issue in the server.
  • Plugins conflict
  • Heavy load in the server which results in WP-Cron not executed fully
  • WordPress bug
  • Using of cache plugins that prevent the WP-Cron from loading
  • And many other reasons

There are many ways to solve the WP-Cron issue, but the one that I am going to propose here is to disable the virtual WP-Cron and use a real cron job instead.

Why use a real cron job?

By using a real cron job, you can be sure that all your scheduled items are executed. For popular blogs with high traffic, using a real cron job can also reduce the server bandwidth and reduce the chances of your server crashing, especially when you are experiencing Digg/Slashdot effect.

Scheduling a real cron job

To configure a real cron job, you will need access to your cPanel or Admin panel (we will be using cPanel in this tutorial).

1. Log into your cPanel.

2. Scroll down the list of applications until you see the “cron jobs” link. Click on it.


3. Under the Add New Cron Job section, choose the interval that you want it to run the cron job. I have set it to run every 15minutes, but you can change it according to your liking.


4. In the Command field, enter the following:

wget -q -O - >/dev/null 2>&1

Replace with your website URL.

5. Click the “Add New Cron Job” button. You should now see a message like this:


6. Next, using a FTP program, connect to your server and download the wp-config.php file.

7. Open the wp-config.php file with a text editor and paste the following line:

define('DISABLE_WP_CRON', true);

8. Save and upload (and replace) this file back to the server. This will disable WordPress internal cron job.

That’s it.

To test it out, it is best to schedule a post 5 – 10 minutes after you have completed the above configuration. Wait and see if the WordPress internal cron job is fired. If yes, then congratulation, you have successfully scheduled a real cron job for WordPress. If no, go through the steps above and see if you have made any mistake. Alternatively, contact your web host and get them to configure for you.

  • Glenn Bennett

    Thanks a lot for this. It took me way to much time to find this info.

  • crepmaster

    i’m a little bit confuse with cron, cron-wp etc… i need to update a table one a day. and i built the function level_update. Where do i need to insert that function? in wp-cron.php?

  • Damien Oh

    the functions.php file in your theme.

  • Anupam

    Thanks a lot. Your post was really helpful.

  • Julia Barnickle

    Thanks Damien – it worked for me.

  • XcKoN

    Cool, this was the explanation that i was looking for =).
    Just a question, what would happen if the cron takes 30 minutes or one hour to finish, because you are running all the crons every 15 minutes, WP keeps a track of what crons are running or something like that?

  • Damien Oh

    You only set a cron to run WP cron, so that is not an issue if the cron the 30 minutes to complete. WP will do the work.

  • Lane Goldberg

    So I have a plugin that relies on wp-cron. When certain things are updated in the backend it runs WP Cron. For that reason, I don’t want to define(‘DISABLE_WP_CRON’, true); Do you think there would be any problems if I run crontab AND keep WP_CRON enabled?

  • Damien Oh

    Nope. The real cron job is calling the wp-cron as well, so there are no conflicts when both are enabled.

  • Tevya Washburn – FS

    Will this work for Multisite? Seems like I saw somewhere that wp-cron had to be called for each site on the network when using Multisite.

  • Damien Oh

    This won’t work in a multisite setup. You will have to setup a cron job for each domain mapped in the multisite settings.

  • Greg Rosenberg

    Am I not mistaken, but you want to “fire” the wp cron job in the wp-cron.php not the wp-config.php?

  • Damien Oh

    wp-config.php does not do the cron job. The file that does the cron job is the wp-cron.php. So it is logical to “fire” the wp-cron than then “wp-config”.

  • Greg Rosenberg

    I was referring to your own instructions above:

    7. Open the wp-config.php file with a text editor and paste the following line:

  • Damien Oh

    I understand what you mean now. The wp-config.php is the file that contain all the configuration options. Since we want to disable the wp cron, wp-config is definitely the place to go. However when executing the actual cton job, the file to be called us wp-cron.

    Hope this is clear.

  • Rohit Agarwal

    Thanks Buddy!! I had some problem with wordpress cron job.. now I can easily manage cron job. :-)

  • Vivianne

    Hi Damien! I bought a plug in called Follow Up Emails to work in conjunction with Woo Commerce and I have it set to send a follow up email 2 minutes after a product order is processing. It is not working! These are actual orders so I’m not sure it fits into the category you describe above. The Follow Up Emaill seems to work ok when I ask it to send 2 minutes after the order is completed but I have to manually check it as completed and it is not convenient for customers to wait for me to check the completed box to get their downloads, etc. Do you think going through the process you describe would help to fix my situation? Thanks in advance! Are you available for hire to troubleshoot??

  • Damien Oh

    There are few possibilities: The followup email is not hooking to the correct action, that why it is not firing off after the order is completed. Alternatively, the followup email could be working fine, but the cron job is not firing. I think you will need to contact the developer and have him/her to look into the issue. If you need my help, feel free to contact me at twitter @damienoh.

  • LiewCF

    Thanks for the detailed instruction. This is very useful. :)

  • Maruf Alam

    Helpful post. Thanks…

  • littleguy

    What will the behaviour be if you setup the Cron job but don’t specify DISABLE_WP_CRON. For example if Cron job stops working I would still like WP to continue doing “lazy mans” (at page load) cron tasks. So can you have the cake and eat it too?

  • Damien Oh

    Nope. It doesn’t matter because they are all calling the same function. On a side note, if you are running a heavy cron job in the backend, calling it frequently (by not enabling DISABLE_WP_CRON) might add burden to your server.

  • Mariana Silveira


    I had to add -O /dev/null to my wget command. Otherwise my home dir got full os zero sized files.

  • Tyrika C Williams

    Vivianne, did you resolve this issue? If so would you mind sharing what the solution was? I am having the exact same issue. Thanks in advance!

  • Sander Bol

    Hi Damien – could you explain why we need to use wget to trigger the cron (ie: making a roundtrip through the network interface and the webserver), instead of running the PHP script directly on the host?

  • Danny Bookworm

    Thanks for your great tutorial! Now, the WordPress Plugin for my Newsletter askes me for a “secret hashtag”. Do you have any idea where I can find this or what I have to do?

  • Jason Coleman

    I think by default WordPress will run unpredictably when called from the command line. For example, it expects to see a $_SERVER[‘REQUEST_URI’] and other globals when run. I’m sure you could rig something up to execute the crons through the command line, but it wouldn’t be as supported as this wget method is on most hosting setups.

  • Rohit Agarwal

    Its very helpful for me!!

  • WP Don

    Will this work for subdirectories vs. multisited domains?

  • Anni

    For users whose cloud server doesn’t have Cron, third party cron service like is a good alternative. It’s quite reliable with log and email notification feature.

  • Andi G.

    Thanks so much for this. I just followed your instructions this morning, and I FINALLY had a scheduled post actually work! This was hugely helpful!

  • Alex Montoya

    Where in the PHP file do we paste define(‘DISABLE_WP_CRON’, true);


  • Damien Oh

    In the wp-config.php file. It should be in the root folder (or a level above the root folder).

  • Tier II Tech Support

    I used this method to set my multiple sites up to run staggered through the night.
    So far it’s been working!

  • Dademaru


    what about if I have WP in a subfolder?

    Should I change with


  • vanderschlecht

    Your “4. In the Command field, enter the following:
    wget -q -O – >/dev/null 2>&1 ”

    doesn’t match the “add new cronjob” screenshot and result screenshot. its missing “/dev/null” infront of the url.
    and there’s this “q” that isn’t in your actual example.
    Any clarification?

  • Rob Redman

    Thanks Damien, this fixed my issue. I was not getting order confirmation e-mails sent to my Customers and myself, on completion of a successful order. This kicked it back into action. Very grateful for your assistance.

  • UTmacca .

    how to use 3rd party cron job like “Easy cron” when a host doen’t support cron job?

  • Jorge Diaz

    Hi Anni, I tried to use but didn’t work, the URL call I used was domain/wp-cron.php

  • Tess

    Hi Jorge, Try Easycron’s WordPress Plugin at, I think it very easy for you.

  • Jorge Diaz

    Thanks, I tried to use it but I failed haha :(