Skip to content

Instantly share code, notes, and snippets.

@davepullig
Last active July 3, 2024 08:19
Show Gist options
  • Save davepullig/efddb9a894e0c4a824b4b61183cfb01c to your computer and use it in GitHub Desktop.
Save davepullig/efddb9a894e0c4a824b4b61183cfb01c to your computer and use it in GitHub Desktop.
WP CLI search and replace URLs for WordPress multisite
wp search-replace --network --url=website.dev website.dev website.tld --precise --all-tables
@mattiasghodsian
Copy link

If you are using subdirectories on multisite

wp search-replace  --network 'example.com' 'example.test'  --all-tables --dry-run 

then

wp search-replace  --network 'example.com' 'example.test'  --all-tables

@kayyumaquaint
Copy link

Hello @mattiasghodsian,
I have a network site with a subdirectory but now I want to change with subdomain so please how can I change with WP CLI.
My current domain is: https://swea.org.hemsida.eu/london
My new domain will be: https://london.swea.org

@mattiasghodsian
Copy link

Hello @mattiasghodsian, I have a network site with a subdirectory but now I want to change with subdomain so please how can I change with WP CLI. My current domain is: https://swea.org.hemsida.eu/london My new domain will be: https://london.swea.org

Did you try the dry run ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment