Community Pick: Many members of our community have endorsed this article.

Moving a WordPress Installation from a Sub-Domain to Root

Heather RitcheyProgrammer
Published:
Updated:
Did you use a default hosting installation of wordpress with the intention of it being your actual site?  Maybe you’ve installed it as a Blog to your current site and recently converted it to be the main site and do away with the old .htm pages.  And the best reason yet – you’re the person hired to revamp an old site for a client that cannot allow down-time or design time during the process interrupting their current site.

Now we have the perfect installation and setup in a sub-domain.  How do we quickly and easily make that a root installation without losing anything or getting into that dreaded PhpMyadmin for crazy attempts at fixing the problem?

It’s not nearly as scary as you think.  All you need is the ftp access, wordpress admin (wp-admin) access (which I’m sure you already have if you’re attempting to do this), and follow three important steps in order.  Key here is “IN ORDER”.

1

First: It’s highly unlikely that you’ll need to worry about overwriting any important files in the root with the exception of the index page.  So first off, in the root, rename the index (any and all – whether they’re .htm, .html, .php, etc.).

2

Next: Log in to the wordpress admin area.  On the menu, choose Settings > General.  You’ll need to change both the wordpress address and the blog address.  Please note that if the current URL in the text field has a trailing slash (/), it’s best to keep this format on the chance that your theme is counting on that trailing slash for any reason. If not, leave it off.

In other words, if the current URL looks like this:
      http://www.mydomain.com/wpblog/
You should enter the root as:
      http://www.mydomain.com/

If it looks like this:
      http://www.mydomain/wpblog
Then enter your root as
      http://www.mydomain.com/wpblog

(Quick reasoning for this, if you have a wordpress code call , such as
      <img src=”<?php bloginfo(‘url’); ?>/images/header.jpg” />
on your images – a simple missing or extra forward slash could make the image not appear.)

Now you can click Save Changes.  Once you do, you will automatically be logged out and it will seem at this point be broken.  No worries, on to the last step.

3

Ftp to the site.  Navigate to the directory for the sub-domain.  Select all or highlight all files in the sub-domain.  Use your mouse to drag all the files up one level to the folder that has the trailing dots (typical ftp view, but yours may look different depending on the ftp software you use.)

This quickly moves all the files to the root.  Now you can log back into the wp-admin from the root instead of the sub-domain and the wordpress site should already be visible by visiting the normal domain name.
All in all, roughly about five to ten minutes to complete depending on your Internet connection speed.  Wasn’t so bad, was it?
3
6,088 Views

Comments (1)

Good stuff Dzynit. Thanks for your contributions! I have a few sites I have to move over, so I'll let you know how it goes.

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.