Categories
WordPress

Change site url with WP-CLI

$ wp search-replace 'site1.fi' 'site2.fi'
First parameter is the old URL and second parameter is the new URL

If you want to see the report without applying changes add --dry-run flag like in example below.
$ wp search-replace 'site1.fi' 'site2.fi' --dry-run

Changing site url in WordPress multisite

$ wp search-replace 'site1.fi' 'site2.fi'  --url='site1'

Read more about wp search-replace