If you want to use
crontab Linux command with WordPress, you should first read this great explanation of crontab by Kevin van Zonneveld. Seriously, this is probably the simplest guide ever.
Now that you read it, you want to use it for WordPress. You don’t want to store output so you are trashing it, and you are calling WordPress pseudo cron functionality, located in
/wp-cron.php file. We use curl for this.
* * * * * curl http://example.com/wp-cron.php > /dev/null 2>&1
example.com with your actual domain. In this example we use
crontab every minute, but you can follow this guide for setting any value.
Don’t forget to save new settings when you are done!
2 thoughts on “How to Use Crontab With WordPress”
Do you know if it is necessary to run this for every domain on a multisite network? Or can you get away with just running it on the root domain?
I haven’t tested that, but quick web search suggests that you need to run it for every domain, which is how I suspected to be because there can be many sites in multisite and too much to process during a single request.