It’s always better to add a cronjob for running WordPress’ cronjobs. If you don’t, you’re dependent on website visits to launch cronjobs.
Luckily we have wp-cli for that, the wp cron event run --due-now
command will process any cronjobs in queue. If you add this to your crontab, you’re all set.
Except for multisite
Each site within a multisite has it’s own cronjob queue, so it’s important to fire these for all websites. The snippet below will do exactly that!
wp site list --field=url | xargs -i -n1 wp cron event run --due-now --url="{}"
Leave a Reply