Portal Home Knowledgebase 3. WordPress Changing WordPress Site URL using WP-CLI

Changing WordPress Site URL using WP-CLI Print

  • 0

How to Change WordPress URL via WP-CLI

Changing the home and site URLs in WordPress can be efficiently done using WP-CLI, bypassing the need to navigate through the admin dashboard.

Change the Home Address

To update the home address, run the following command in your terminal:

 
wp option update home 'http://testing.com'

Change the Site URL

To change the site URL, use this command:

 
wp option update siteurl 'http://testing.com'

How to Update WordPress via WP-CLI

Updating WordPress files and the database can also be done seamlessly using WP-CLI. Follow these steps:

Update WordPress Files

First, ensure your WordPress files are up-to-date by running:

 
wp core update

Update the Database

To check if it is necessary to update the database to the latest version, use:

 
wp core update-db

Check Your WordPress Version

To verify your current WordPress version, you can check it by executing:

 
wp core version

This concise guide provides clear commands for changing the WordPress URL and updating the site via WP-CLI. You can modify any part to fit your audience's needs!

 
 
 

Was this answer helpful?

« Back