WordPress Docker CRON jobs

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.

This solution from here.

Danny Eckes
Danny Eckes

Welcome to my personal blog! This site is dedicated to my personal interests in IT, Photography, and Cooking. Running an IT homelab and needed a website for proof of concept and constant tinkering. I figured recipes would make good content. Let's face it, finding recipes online can be challenging! Between navigating past countless ads and lengthy superfluous instructions, it takes far too long to find the actual recipe. Posting recipes here for my quick reference. Hope you can find them useful as well. Pictures (taken with mobile) and instructions written for myself.

Articles: 60