WPorb

📝 Change Your Domain with WP-CLI Command Line Tool

The WP-CLI command line tool is essentially a handy application to run various WordPress tasks

The WP-CLI command line tool is essentially a handy application to run various WordPress tasks. Download the WP-CLI command line tool into the WordPress root folder using CURL or WGET.

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Check if the tool is working.

php wp-cli.phar --info

Alternatively, You can follow the tutorial here to view the set-up wp-cli on your server. Not run the search and replace command to look through all the core tables to change the URL.

php wp-cli.phar search-replace 'http://www.olddomain.com' 'http://www.newdomain.com'

This will save you numerous hours and give you some peace of mind!

Alternatively, you can use the option update commands below to change the URL.

wp option update home 'http://example.com'
wp option update siteurl 'http://example.com'

Since people have multiple plugins installed and setup, you want to test this on a staging environment before running it on a production site.

1 comment

Do you have a
WordPress problem?

Select what best describes your goals:

HOLD ON!

Do you have a
WordPress problem?

Become a WordPress Pro
with our easy to follow guides .

Hire an Expert to quickly solve
any WordPress related task.

We use cookies to provide an awesome experience on our website. By continuing to use this site, you agree to our tasty cookies.
🍪 Accept Cookies
Privacy Policy