Skip to content

Instantly share code, notes, and snippets.

@guillaumemolter
Created March 9, 2017 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guillaumemolter/890c23272173469cf488a71b3ea46016 to your computer and use it in GitHub Desktop.
Save guillaumemolter/890c23272173469cf488a71b3ea46016 to your computer and use it in GitHub Desktop.
A list of usefull commands to maitain a WordPress multisite install using WP-CLI
# Network wide search and replace
wp search-replace 'NEEDLE' 'HAYSTACK' --network --verbose
# Network wide search and replace for domain (ie: prod to dev DB migration)
wp search-replace 'old.domain.com' 'new.domain.com' --network --verbose --url=old.domain.com
# Network wide rewrite rules and permalinks flush
wp site list --field=url | xargs -n1 -I % wp rewrite flush --url=%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment