Last active
June 27, 2016 02:38
-
-
Save chinmayrajyaguru/1b7a4c14a76d4ce7cbca2df8e0399e31 to your computer and use it in GitHub Desktop.
Change the WordPress siteurl & home URL using MySQL command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* When moving sites from one location to another, it is sometimes necessary to manually modify data in the database to make the new site URL information to be recognized properly. Many tools exist to assist with this, but generally I use this method */ | |
-- Login to MySQL | |
use database; | |
show tables; | |
SELECT * | |
-> FROM `wp_options` | |
-> LIMIT 0 , 30; | |
update wp_options set option_value = 'http://example.com OR http://Server_IP' where option_id = 1; -- Most important to pick correct option_id for change "siteurl" option_value | |
update wp_options set option_value = 'http://example.com OR http://Server_IP' where option_id = 1; -- Use this command again to change "home" option_value | |
EXIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment