Skip to content

Instantly share code, notes, and snippets.

@jasperf
Last active November 4, 2021 02:59
Show Gist options
  • Save jasperf/71a9b08ad725e4c08edd428a2e545521 to your computer and use it in GitHub Desktop.
Save jasperf/71a9b08ad725e4c08edd428a2e545521 to your computer and use it in GitHub Desktop.
search replace site name in WordPress Database using WP CLI and add new admin for local testing
### dry run
wp search-replace 'live-site.com' 'test-site.test' --skip-columns=guid --dry-run
### for real
wp search-replace 'live-site.com' 'test-site.com' --skip-columns=guid
### add admin user
wp user create jasper [email protected] --role=--role=administrator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment