Changing the site url in WordPress

If you move your wordpress installation to a new location (a new domain or another folder), you need to change all urls within your wp database. You might find some plugins to do this task but in my opinion the easiest way to do this is by using phpMyAdmin. Just run the following SQL Statements with your old a new location:

UPDATE wp_posts SET guid = REPLACE (guid,'www.oldsite.com','www.newsite.com');
UPDATE wp_posts SET post_content = REPLACE (post_content, 'www.oldsite.com', 'www.newsite.com');
UPDATE wp_options SET option_value = replace(option_value,  'www.oldsite.com', 'www.newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl';

You might also need to remove the entry “rewrite_rules” in your wp_options table.

Have fun!

Share this

The Author

admin - Hello, my name is Simon, I’am 25 and I’m a software and web developer. My interests span all aspects of programming and development, including ASP, JavaScript, AJAX, PHP, .NET, Java, C#, C++, Objectv-C, Flash, Cocoa, SQL, XML and everything in between. www.simra.ch

Leave a Reply

*
 
© 2010 onYou GmbH. All Rights Reserved