Skip to main content
9 events
when toggle format what by license comment
Mar 28 at 10:38 comment added Jesse Nickles Several bloggers seem to have ripped off this answer over the years without crediting you, it's one of the earliest snippets I have seen, so kudos!
Apr 16, 2017 at 0:44 comment added puzzlement For the benefit of future readers, the script then looks like: WP_PATH="/path/to/wp"; for SITE_URL in $(wp site list --fields=domain,path,archived,deleted --format=csv --path="$WP_PATH" | grep ",0,0$" | awk -F ',' '{print $1 $2}'); do wp cron event run --due-now --url="$SITE_URL" --path="$WP_PATH"; done
Sep 14, 2016 at 16:18 comment added jgraup wp cron event run --due-now --url="$SITE_URL" --path="$WP_PATH - According to the run docs, you should utilize the --due-now flag. This would reduce the lookups and individual event calls. See: wp-cli.org/commands/cron/event/run. Either way, I'm with @OmarJackman - he's utilizing the command line to use WordPress command line tools. Props for a clean Bash example. You could round out this answer by showing the crontab entry.
Dec 3, 2015 at 18:15 comment added DiverseAndRemote.com @KolyaKorobochkin I disagree. This isn't hacky at all since WP CLI was made to be used on the command line and in bash scripts.
Jan 31, 2015 at 14:15 comment added Kolya Korobochkin Hm thank you for your opinion but I think this is hacky (dirty) solution. I think will be better write some PHP addon for wpcli which just run all needed tasks. I need more time to understand WP functions and code to do it.
Jan 28, 2015 at 6:03 history edited DiverseAndRemote.com CC BY-SA 3.0
added 85 characters in body
Jan 28, 2015 at 5:54 history edited DiverseAndRemote.com CC BY-SA 3.0
added 7 characters in body
Jan 28, 2015 at 5:48 history edited DiverseAndRemote.com CC BY-SA 3.0
added 64 characters in body
Jan 28, 2015 at 5:36 history answered DiverseAndRemote.com CC BY-SA 3.0