Skip to content

Instantly share code, notes, and snippets.

@iamcryptoki
Created January 27, 2023 07:39
Show Gist options
  • Save iamcryptoki/ae43aa11dffec729cd80c5e463400d72 to your computer and use it in GitHub Desktop.
Save iamcryptoki/ae43aa11dffec729cd80c5e463400d72 to your computer and use it in GitHub Desktop.
Replace site URL in your Wordpress database when moving to another environment.
# Run the entire search/replace operation and show report, but don't save changes to the database.
$ wp search-replace '//example-dev.com' '//example.com' --all-tables --skip-columns=guid --dry-run
# Save changes to the database.
$ wp search-replace '//example-dev.com' '//example.com' --all-tables --skip-columns=guid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment