Skip to content

Instantly share code, notes, and snippets.

@chinmayrajyaguru
Last active June 27, 2016 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chinmayrajyaguru/1b7a4c14a76d4ce7cbca2df8e0399e31 to your computer and use it in GitHub Desktop.
Save chinmayrajyaguru/1b7a4c14a76d4ce7cbca2df8e0399e31 to your computer and use it in GitHub Desktop.
Change the WordPress siteurl & home URL using MySQL command line
/* 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