Skip to content

Instantly share code, notes, and snippets.

@tott tott/
Created Nov 16, 2019

What would you like to do?
Execute WP-Cron on multisite through wp-cli
function run_cron_due_now {
for SITE_URL in $(wp --allow-root site list --fields=url --format=csv | tail -n +2 | sort); do
wp --allow-root cron event run --due-now --url="$SITE_URL" && echo -e "\t+ Completed Crons for $SITE_URL" &
wait $(jobs -p)
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.