Top Nav

How to Move a WordPress Installation to a New Directory

I’m a compulsive re-organizer. Every now and then, I just completely re-arrange my office furniture to shake things up. Same goes for my WordPress blog location. Recently, I moved my WordPress blog from oneofmydomains.com/main to blog.anotheroneofmydomains.com. It was relatively easy. But there are some important steps you should remember when moving WordPress sites to a new directory to ensure that you don’t ruin everything. Regardless of whether or not your reasons for migrating a WordPress installation are better than mine, you should follow these steps:

Backing Up Your WordPress Blog Posts

Before you attempt any of the WordPress migration methods, make sure you back up your WordPress blog. If anything goes wrong, you’ll be able to restore the content of your posts from this backup.

Step 1

Log in to your WordPress dashboard at /wp-admin.

Step 2

Expand the Tools menu and Click Export.

Step 3

Choose which data you want to export and Click Download Export File.

Moving WordPress.org Install to another directory

Now, if anything goes wrong, you can use the Tools > Import function to restore your old posts. This is the quickest and easiest backup method that only saves the content of your posts—it won’t save your settings, images and custom plugins, etc. For that, you should backup your entire WordPress site.

Move a WordPress Site to a New Directory

Step 1

Create the directory on your server. You can do this using any FTP client, or cPanel. If you’re creating a subdomain, you should do this ahead of time since it can take a few minutes for the change to take effect.

Moving WordPress.org Install to another directory

Step 2

Log in to your wp-admin dashboard. Expand the Settings menu and Click General.

Moving WordPress.org Install to another directory

Step 3

Change the WordPress address (URL) and Site address (URL) to your new WordPress location.

Moving WordPress.org Install to another directory

Step 4

After you Click Save Changes, you’re going to get an error message. This is normal, because your blog hasn’t been moved yet.

Moving WordPress.org Install to another directory

Step 5

Using a FTP program, move the entire contents of your WordPress directory to the new directory. This includes all the files in the root of your WordPress installation’s current location and subfolders. So, if your WordPress blog is installed at yourdomain.com/blog, move everything in yourdomain.com/blog. If your WordPress blog is located at yourblog.com, move everything in your root and plunk it into the new location you created in step one.

Relocating WordPress Installation

Step 6

Navigate to your new blog location to verify that it worked.

Migration WordPress

If so, go ahead and log in to your wp-admin dashboard.

Step 7

If you use permalinks (which you should), Click Settings and choose Permalinks.

Moving WordPress.org Install to another directory

Click Save Changes (you don’t have to change any options) to update your permalink structure.

Moving WordPress.org Install to another directory

Step 8

Click the Media tab in the Settings menu.

Moving WordPress.org Install to another directory

Step 9

Change the path in Store uploads in this folder to your new location. Note: I skipped this step and had no problems, but depending on which plugins you use, you may need to update your upload location.

Moving WordPress.org Install to another directory

After that, you should be all set. Note that if you used full paths when embedding images/links in your blog, they may be broken now. But if you used relative paths, such as /wp-content/uploads they should be fine. Either way, you may want to double-check to make sure everything made it over.

More Reading:

,

7 Responses to How to Move a WordPress Installation to a New Directory

  1. Dinesh @DailyBlogMoney January 29, 2011 at 8:44 pm #

    Thanks for the clear step by step methods with screenshots.
    I wanted to ask a question, How did you manage to redirect the incoming back links from your old domain to new domain?

    It would be great if you share them too.

    • groovinJackman January 30, 2011 at 7:06 pm #

      hi Dinesh — that’s a good question, and I think I have a good answer…I’ll cover it in my next blog post

  2. Vadim Schmidt February 2, 2011 at 9:46 pm #

    Good stuff jack.

    Here is a great resource when you want to move your WordPress blog. This has pretty much all the different scenarios for when you need to move a wordpress blog. I just used it actually when I moved domains.

    http://codex.wordpress.org/Changing_The_Site_URL

    You guys should explore this doc and improve on it since most of the steps are not in screenshot format like what you guys do. Perhaps do 1 write-up for each scenario!

  3. Stephen February 11, 2011 at 11:27 pm #

    Thank you so much! This went seamles. My domain is now in a new folder and works fine!

  4. Timmy Howard December 5, 2011 at 12:27 am #

    Awesome awesome awesome write up lads. Killer stuff:)

    Tim

  5. The Kodz December 31, 2011 at 6:58 am #

    Helped me a lot in moving my blog to hostgator. Thanks.

    • Steve Krause January 1, 2012 at 12:45 pm #

      Awesome! I’m glad it helped ya out — welcome to my blog. Hope to see you around.

Leave a Reply