WordPress/MySQL change URLs

Connect to MySQL and view tables to see what you need

USE <DB_NAME>;
SHOW TABLES;

Grab site URLs

SELECT * FROM wp_options WHERE option_name = 'home';
SELECT * FROM wp_options WHERE option_name = 'siteurl';

**NOTE** Multisite setups are different.  Each site has their own set of wp_options, depending on your site, it may be set to different numbers.  Typically, it will be wp_2_options, wp_3_options, etc.

Replace values with what you want

UPDATE wp_options SET option_value="http://new_host/wordpress" WHERE option_name = "home";
UPDATE wp_options SET option_value="http://new_host/wordpress" WHERE option_name = "siteurl";

**NOTE** For multisite setups, make sure your wp_options match the number for the site in question.  

Leave a Reply

Your email address will not be published. Required fields are marked *

*