How to move your WordPress blog to root directory without harming SEO?


I know how annoying it becomes when you want to move your WordPress to some other directory or root directory. Lots of troubles like missing images, broken layout or even many a times the whole website gets broken. Even I have faced this problem earlier. So I thought to write a detailed post on How to move your WordPress blog from any directory like to your root directory 

And if you want to move your website to any other directory rather than root directory than procedure is still same but rather

So Let’s begin to move your website to root directory. And also for your ease I have separated the whole procedure in simple steps.

[box type="shadow" align="alignleft" width="1" ]HOW TO MOVE YOUR WEBSITE TO ROOT DIRECTORY (WORDPRESS):[/box]

Step 1. Do a complete backup of your website even the database. Because many a times we get unlucky and lose everything. :(

Step 2. Make your root directory ready by cleaning current files and folder there.

Step 3. Deactivate all the caching plugins and any other plugin you are using for redirection.

Step 4. Go to your WordPress admin area (where you are running your blog right now) than settings than General and update your WordPress Address and Site Address to the root directory. Like earlier it was so make it only. Do this in both the fields i.e WordPress address and Site Address. And Save. Like I did in screenshot below.

root directory URLsStep 5. Now don’t check your blog. Go to your file manager through cpanel (hosting account) and copy all your folder like wp-content, wp-admin, wp-includes or any other directory to your root folder. Also copy the file wp-config.php.

Step 6. Download a fresh copy of WordPress, delete all the directories wp-content, wp-includes etc and also delete wp-config.php file. Make sure you don’t delete any other file. And upload this folder to our root directory also extract it to your root directory if you have uploaded the zip file.

Step 7. You have everything ready. All the files and all the directories.

Step 8. Now 301 redirect your directory website to your root directory website using .htaccess file. We are doing this to prevent duplicate media files issue that harms our SEO and also all images will be missing in your posts unless you redirect everything. Here is the code you need to paste in .htaccess file present in your directory website to 301 redirect. Don’t forget to change the URL present in the code to your own root URL.

# This allows you to redirect your entire website to any other domain
Redirect 301 /

Step 9.  Oops. This isn’t a step but You’re Done. You can login to your new moved website.

[box type="warning" align="aligncenter" ]Don’t forget to:[/box]

1. To reactivate all the plugins you deactivated earlier.

2. Rebuild your sitemap

2. Change the permalink structure of your root website from setting > permalink  in your new WordPress admin if you had any custom permalink structure in previous root directory website.

3. Decide you want your website with www or without www because search engines consider it two unique website. I would suggest you to read Ana’s post on www or non www

[box type="note" ]Additional tools:[/box]

You can also use Velvet Blues Update URLs plugin to change the media source URLs to new moved media source URLs. And if you use this plugin don’t forget to delete all the media file which you had in your

This will avoid duplicate media files issue and prevent any SEO loss.

If you are stuck somewhere just let me know in comment below.

Leave a Reply

About Raj Sharma

Hey There! I am a passionate blogger and a web entrepreneur. I am addicted to internet and making money online. I am the founder of and other amazing websites.

Leave a Reply