Loading...

How to setup server cron in WordPress

How to setup server cron in WordPress

Jul 29, 2024

There are many times we have seen that our WordPress cron does not work as expected or always.

By default WP cron runs when they receive a traffic on the server but this is an old approach and many people use latest approach by disable the WP_CRON and enabling it via server cron.

To enable it via server cron we can add

// wp-config.php
define( 'DISABLE_WP_CRON', true );

Then add below line into your crontab

*/5 * * * * wget --delete-after http://YOUR_SITE_URL/wp-cron.php

By doing this we make sure that cron will run every 5 minutes regularly even if there is no visitors on the website.

I hope this article helps and let me know your suggestions below.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Popular Post