Skip to content

Instantly share code, notes, and snippets.

@D4R4
Last active July 1, 2019 18:20
Show Gist options
  • Save D4R4/1a0f910c19de3373e22a7f3cbf3fb7c2 to your computer and use it in GitHub Desktop.
Save D4R4/1a0f910c19de3373e22a7f3cbf3fb7c2 to your computer and use it in GitHub Desktop.
Replace text (olddomain,newdomain) in wordpress Options while keeping serialization intact using WP CLI
wp search-replace 'https://old-domain' 'https://new-domain' --skip-tables=wp_users --skip-columns=guid --dry-run
Remove --dry-run once you're sure nothing will be replaced that should not be.
You cannot do both a --dry-run and an --export=<filename> in the same command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment