Last active
March 28, 2024 10:42
-
-
Save bjornjohansen/c29854dd6a0cf0ad694f to your computer and use it in GitHub Desktop.
Ping cron for all sites in a WordPress multisite network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ref: https://www.bjornjohansen.com/wordpress-cron-wp-cli