Skip to content

Instantly share code, notes, and snippets.

@bjornjohansen
Last active March 28, 2024 10:42
Show Gist options
  • Save bjornjohansen/c29854dd6a0cf0ad694f to your computer and use it in GitHub Desktop.
Save bjornjohansen/c29854dd6a0cf0ad694f to your computer and use it in GitHub Desktop.
Ping cron for all sites in a WordPress multisite network
#!/bin/bash
WP_PATH="/path/to/wp"
for SITE_URL in $(wp site list --fields=url --archived=0 --deleted=0 --format=csv --path="$WP_PATH" | sed 1d)
do
/usr/bin/curl -L -s -o /dev/null "${SITE_URL}wp-cron.php"
done
@jessuppi
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment