
Editing wp-config file
Add this line in your wp-config.php and save it,
update_option('siteurl','http://example.com/blog');
update_option('home','http://example.com/blog');
define('RELOCATE',true);
Editing Database
This may cause damage if not done properly, so I suggest you to back up your database first. Now, login to phpmyadmin and select your WordPress database. Then go to tab “Query” . At the bottom there is a text are with name “SQL query on database ur_databasename” .
Below there put the code below
UPDATE wp_posts SET guid = REPLACE (
guid,
'http://oldsiteurl.com',
'http://newsiteurl.com');
And press submit query , code above will automatically replace all old url with new url supplied on selected table.
guid,
'http://oldsiteurl.com',
'http://newsiteurl.com');
Leave a Reply