I've set up a redesign of a site in the subdomain to work out any kinks and to make sure everythings working ok before setting it up on the root domain. I've looked up transfers but have only found info on transfering from host to host or from local to host.

I've set up a wordpress site that was previously locally hosted, so I know how to transfer a site, I'm just hoping that there is an easier way to do this since this is transferring from subdomain to domain - like hopefully without having to reinstall wordpress...

Any solutions or suggestions welcome.

Thanks in advance.

  • 1
    If it's just a redesign, why not just copy the theme from the subdomain to the main domain?
    – Andy
    Commented Mar 30, 2011 at 19:46

2 Answers 2


After copying to the main-directory change the values in then wp-config.php and .htaccess files for the new localtion. Then you have to change the values in the database. You need 3 SQL-Statements, which you can execute with phpMyAdmin for example.

First change the options-Table

UPDATE wp_options
SET option_value = replace(option_value, 'http://www.example.com/subdir', 'http://www.example.com')
WHERE option_name = 'home' OR option_name = 'siteurl';

Second change the values for the guid in the posts-table

UPDATE wp_posts
SET guid = replace(guid, 'http://www.example.com/subdir', 'http://www.example.com');

Third change the URL in the posts-Table

UPDATE wp_posts
SET post_content = replace(post_content, 'http://www.example.com/subdir', 'http://www.example.com');

If you have used another prefix then wp_ you have to change it in the 3 SQL-Statements. Pay attention at the example domain-names, too.

  • and if you have some custom fields or plugin that store the entire path of images in the custom field (like, jQuery Featured Slider...) you have also to take this in account. Change the reference for wp_postmeta.
    – keatch
    Commented May 29, 2011 at 21:22
  • the wp-config.php and .htaccess files didn't need to be modified at all when I've done this before, and you can use the wordpress settings page proper to change the home of the blog from, say, blogtest.domain.tld to domain.tld/blog - so long as the webserver is properly configured, you can just change where apache (eg) serves the domain from to be a different directory, or you can move it on the server to where apache expects it to be once the config changes in wp have been done
    – warren
    Commented May 29, 2011 at 22:36

wordpress.org-support-moving-wordpress helped me, on a virtual machine running ubuntu, use the from existing server., i used the velvet plugin for url updating/re-write and seems to work maybe 1 or 2 broken images or attachments but it done 99% of the work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.