Cron doesn’t run on docker with WordPress container. Solution is to create a scheduled task to run wp-cron.php. I’m doing this on Mac but you can do on Linux and windows. Best to run on the web server host.



Disable cron from running on WordPress page loads
Add the following command to the wp-config.php file just above where it says “/* That’s all, stop editing. Happy Blogging. */”
define('DISABLE_WP_CRON', true);
Add cron job to macOS via terminal
- Open terminal and open the Cron jobs:
crontab -e
- Press i for insert
- add the following job (run every 5 mins):
*/5 * * * * curl https://example.com/wp-cron.php
- Press escape to exit
- type “:wq” (without the quotes) to save, then enter.
If Any of Your Crontab Tasks No Longer Works on macOS Catalina
It turns out to be a permission issue. To solve it, just add your cron
location (in most cases /usr/sbin/cron
) to the Full Disk Access lists located at System Preferences.app -> Security & Privacy -> Privacy -> Full Disk Access
. “Click the lock to make changes” and “+” to navigate to your cron
location.