How to Move WordPress to another directory or folder

by on March 3, 2011 · 182 comments

If you installed WordPress in a sub-folder or sub-directory under your domain, and want to move it to the root of the domain, there are a few things you need to be aware of.

For example, what if you installed WordPress in: http://www.yourdomain.com/wordpress/

but you want to move it to to top level of the domain like this: http://www.yourdomain.com/

Well, its not hard if you know what to look for. In this video, I’ll show you how to move your WordPress installation to another directory and how to make sure that all of your content and images are moved over properly too.

Here’s a quick summary of the steps in the video:

  1. Update the WordPress address and site address in the WordPress database
  2. Move the files to the new location
  3. Fix up the URLs to any files or images you have uploaded via WordPress

Note: Make sure you back everything up before moving things!

Let me know if you have any questions in the comments below.

Like what you read?

If so, please join over 10,000 people who receive exclusive weekly online business and blogging tips, and get a FREE COPY of my eBook, 10 Steps to Free Website Traffic! Just enter your name and email below:

Subscribe Now

Article by »

Don is an entrepreneur based in Silicon Valley. He founded Expand2Web and is the publisher of the Expand2Web Blog and the SmallBiz WordPress Theme.

Don has written 250 articles on Expand2Web

Author Connect » Twitter | | Facebook |

How The SmallBiz Theme Makes Your Business Website Way Better

If you're building a business website these days, you're in luck.

WordPress has revolutionized the ease and power of what a website can do and be. Now you can quickly create a website that is optimized for top search results, and update it yourself whenever you want.

As you'll see in a moment, the SmallBiz Theme is much more than a mere WordPress theme. It's a complete solution for your business web presence including a Website, Blog, Facebook Page and Mobile Website.

Let's take a look at each of these, and how they help you generate new business from the web…

Click to continue...

See my disclosure about advertising and affiliate links

{ 182 comments… read them below or add one }

Timmy Howard December 5, 2011 at 1:34 am

Great write up. Much much much appreciated!!

Reply

yourstoryclub December 5, 2011 at 9:48 am

thanks Don, exactly this I wanted to move stuff from yourstoryclub.com/wpstoryblog to simply on yourstoryclub.com before I use permalink and SEO optimization. Let me try. Will get back to you with result :-)

Reply

Craig Hawke January 11, 2012 at 5:02 pm

Oh no!! Houston we have a problem!

I followed your instructions because I wanted to change the directory from http://products.takeaction-now.net/wordpress to http://products.takeaction-now.net. I changed the url in Settings in WordPress and saved them.

I then went to the Move files in the file manager of my cpanel and when I clicked Move, I received a message saying the files/folders already exist!
Now I cannot access WordPress as Admin as the url is now dead.

I have checked the file manager and from what I can tell from my limited experience the WordPress folder is unchanged.

Am I dead in the water and will I have to delete WordPress and reinstall and start my Website from scratch??

Thanx……Craig :(

Reply

Don Campbell January 11, 2012 at 10:15 pm

Hi Craig,
So you had WP installed in the /wordpress folder, and you wanted to move it to the / folder, right?

You need to copy all those files to the root directory. I’m not sure how you did the copy but you can probably ignore the files exist message and copy them over anyway.

If you want to restore the URLs in WordPress back to what they were, you can use the wp-config.php file in your /wordpress directory to do that. See this article: http://codex.wordpress.org/Changing_The_Site_URL#Relocate_method

Reply

Craig Hawke January 11, 2012 at 11:29 pm

Yes that’s correct Don,

I have WP installed in products.mydomain.com/wordpress and want to move it to products.mydomain.com/. The issue I have is the file manager in cpanel doesn’t have a select all to move files or folders. From what I can see you would have to move one file at a time…not very efficient.

I then decided to use Filezilla (I am a Ubuntu user) to copy files and have since found out this is not a permitted function. Apparently one has to copy/move files to pc, then copy/move them to directory on server! This seems a waste of effort to me?

Can you suggest another way to do this? Or a different ftp client?

Cheers….Craig

Reply

Don Campbell January 11, 2012 at 11:41 pm

Craig, I’ve used many ftp clients and they all allow you to move files and folders directly on the server without having to download them to the PC first. There must be something in the way you are selecting the files…

Here’s a screen shot of how to move files using the File Manager in BlueHost’s Cpanel: click here for screen shot

Reply

Craig Hawke January 12, 2012 at 1:50 am

Yeah you are probably right Don….

I’ll do some more research and if I am not confident I can do this I will contact my hosting company to see if they will do it for me.

Thanks …. Craig

Reply

adam January 21, 2012 at 4:43 am

Hi,

Nice video, very useful. I have done all the steps and my home page comes up but none of the posts come up, I have 404 error.

any ideas?

thanks
adam

Reply

Doris February 14, 2012 at 12:47 pm

Hello Adam,
I have exactly the same problem today. Did you find the reason why you had this problem? Kind regards, Doris

Reply

Doris February 14, 2012 at 1:15 pm

Hello again,
I have found the solution: might help someone else.
I deleted the .htaccess file in the directory where WordPress is installed, for ex. mysite/wp, and then resaved the permalinks under Settings.
This created a new .htaccess file which fixed the problem.
Doris

Reply

Susan January 29, 2012 at 2:08 pm

Thanks for the helpful video. I just moved my WordPress site into the top level directory and thanks to your help, it was a snap!

Susan =)

Reply

Don Campbell February 17, 2012 at 12:18 pm

That’s great – thanks for dropping by Susan!

Reply

Josh February 17, 2012 at 12:12 pm

Good tutorial. First timer here. What do I do if there’s files (existing site that I’m replacing) already in the parent/root directory? Do I delete all those files, or are there some that should remain?

Reply

Don Campbell February 17, 2012 at 12:19 pm

Hi Josh,
I ALWAYS back them up first. Then depending on the site, you can delete the index.html or index.php that is in the root before moving WordPress over it.

Reply

Roger February 22, 2012 at 4:55 am

Brilliant! Sooooooo much clearer than the crap on Wordpress.org that is almost unintelligable! Thank you, thank you, thank you!

Reply

Don Campbell February 25, 2012 at 8:17 am

Thank you Roger!

Reply

Noah February 25, 2012 at 12:12 am

I’m on a mac as well — which FTP app are you using to move them over?

Thanks for the help

Reply

Don Campbell February 25, 2012 at 8:16 am

Hi Noah,
I use Transmit. I also like CyberDuck (which is free.)

Reply

Emmanuel February 26, 2012 at 3:18 pm

I canged the Url to carushka.com erased press at the end of it. Ok that was done also Im using BlueHost but what do I copy? The press folder? and move iot to where?

Reply

Don Campbell February 26, 2012 at 10:41 pm

Hi Emmanuel,
The video in this blog post walks you through the process. You need to move all the files in the /press folder up one leve to the root. Watch the video to see how it works.

Reply

Emmanuel February 26, 2012 at 10:48 pm

Well I was able to get it with Bluehost techs but its still not right Bluehost techs really suck! They can’t really help much look at my site carushka.com but when you click on home you get carushka.com/press they can’t help me get rid of that. I went into the Phpadmin part of the bluehost removed press at the end and I get 404 Error and I can’t even login to my Wordpress admin its a mess!

Reply

Don Campbell February 27, 2012 at 11:57 am

Emmanual,
The URL still lives in your WordPress DB – I showed how to change that in the video. You can also use this method to change it after the fact:

http://codex.wordpress.org/Changing_The_Site_URL#Relocate_method

Reply

FizX February 27, 2012 at 7:28 am

This Is amazing video you posted .. looks so good to be true .. should i dare try :)

Reply

FizX February 27, 2012 at 7:30 am

One more thing .. moving up one level doesnt mess up my posts plugins or comments right ? i messed it up once before dont wanna be in that mess again ..

Thank you so much

Reply

Don Campbell February 27, 2012 at 11:56 am

No it won’t effect your blog posts and comments. Make sure to backup before you move, of course. Words of wisdom any time you are changing something on your website or blog :)

Reply

FizX February 27, 2012 at 1:17 pm

Thanks DON … it worked wonders :) everything is working fine .. now i have to point my External links in the right direction .. any tips ?

And you done it alot better then other Tutorials who made me think i should be a full DEVELOPER to do that Moving Process … Kudos Mate

Reply

vivek March 1, 2012 at 3:30 am

Thanks a lot..

its really helped me to move my site to another Location..

really thanks ..
vivek

Reply

Ellen Nicol March 4, 2012 at 11:09 am

Help! I just tried doing this and moved everything over like you suggested and my old site is still showing up. I can’t access anything in my blog to change the url back to it now either. So I’m stuck… and freaking out…help!!!

Reply

zeeshan March 4, 2012 at 11:25 am

Give the link mate … and the link you changed into ..

Reply

Alextraz May 1, 2012 at 8:12 pm

Your video is excellent! It worked perfectly.
I had the site transferred in minutes. What a time saver.

Reply

Kroviniu gabenimas May 24, 2012 at 6:25 am

Thanks for a good post.

Reply

anja May 29, 2012 at 4:59 am

usefull video.. i moved my site and made update url plugin. the thumbnails don’t work…. (even if they are in the same directory)
any idea how to update these different sizes?

Reply

Don Campbell May 29, 2012 at 8:49 am

Ajna,
Your image URLs probably still contain the old url. You can easily fix these up with the free Update URLs plugin by Velvet Blues.

Reply

anja May 29, 2012 at 9:54 am

Hi Don,

Thanks for your answer!
I already installed the update url plugin and activated it. when i run it zero attachments are updated…i have appr 88 photos…
in de media library the right url is mentioned (wp/downloads), only the thumbnails don’t show up. in the library when i click on edit picture the photo does show, but not in thumbnail format. is the resizing not done automatically?

Anja

Reply

Don Campbell June 17, 2012 at 11:47 am

Hi Anja,
That depends on your theme. But usually they are not auto resized unless your theme is using Post Images or has something special built in.

Reply

Michael June 8, 2012 at 1:46 pm

I need to go a little further beyond just changing a URL.

Is there a way to configure WordPress to use a remote location for storing all files (e.g. images, HTML, etc)?

The server that hosts my Wordpress site is a virtual machine template that won’t persist content. Any new images or other content I create is lost anytime the server reboots and the original version of WordPress is re-deployed. I do have the ability to modify the instance of Wordpress which is installed on the virtual machine image but any changes I make will be static (i.e. all dynamic content is still lost every time the machine reboots).

I would like to configure this hosted version of WordPress to point to some other location for storing all content. Does anyone know how to do this?

I have a UNC name for a persistent file store that I could use.

Reply

Don Campbell June 17, 2012 at 11:46 am

Michael, honestly I think you should use another method to host your WordPress installation. There are too many things that you could lose by using a transient host like that.

Reply

Eric Irwin June 13, 2012 at 6:08 am

Don,

I’ve used other procedures before for moving WordPress however yours was very easy. I was not aware of that plugin which is much easier than going into PHPMyAdmin and doing a search & replace. It did miss a few links that were relative links (\folder_name\some-image.png) and didn’t include the full URL. I suspect I could have run the program again to automatically fix those links too by entering the relative URL in to the Old URL search box but since there were not many, I just fixed them manually.

Anyway, thanks for the article!

Eric

Reply

dunbar lemonwhistle June 17, 2012 at 9:31 pm

thank you. this saved me big time!

Reply

Edward Chovgan June 18, 2012 at 8:51 pm

Thanks! Keep up the good work.

Reply

Richard June 20, 2012 at 10:35 am

Don,

Thank you so much a brilliant vid and worked perfectly

Reply

Darren Newbery June 26, 2012 at 9:04 am

Hi Don,

Just wanted to say a quick thank you for saving me so much time and headaches in moving my wordpress website. After a few SQL database problems your video worked like a charm.

I really appreciate the time you put into making a high quality easy to follow step by step video like this.

Thanks again,
Darren

Reply

Philip Wragg July 24, 2012 at 1:57 pm

So Simple – why so complicated everywhere else I looked?!… Many thanks

Reply

Beining July 25, 2012 at 7:12 am

Thanks for post! Just what I was looking for! You can see the result here http://www.ulfnilsen.com/

Reply

Sharma August 2, 2012 at 4:10 am

Great tutorial. Simple and easy to follow. I had been trying to do this the same way as if I was changing the domain to entierly new one and not just from root to subdomain. Had created a new database for the subdirectory and things wer not working correctly. I can believe how easy this was.

Reply

Rokgoo August 15, 2012 at 10:14 am

Great video , thanks.

Reply

A1on August 18, 2012 at 5:49 am

Hi There,

Thanks for the post.

However, how it will reflect on the indexed pages by google? if you move a page and someone comes from the search engines you will get lot of “404 page not found” error no? this also can effect your ranking as bounce rate will grow up rapidly till google will index the site again and remove the pages with the old url from the index, this can take time, not mentioning frustrated users that cant view searched /requested pages.

Any solution to not to get yourself penelized by google? if not panalized loosing traffic or serve users that came from search engines..

Thanks,
A.

Reply

Don Campbell August 18, 2012 at 10:10 am

Hello A,
Yes, any time you move a website, if you have URLs on your website that people are linking to or are indexed in Google, you should take care to provide 301 redirects to the new URLs. We’ve got a tutorial showing how to do that in the SmallBiz User Guide.

Reply

BBO August 31, 2012 at 2:56 pm

Just want you to know YOU ARE A LIFE SAVOR!!! I was going to literally pay someone to do this because I didn’t want to mess it up, but after seeing your video.. I backed up my site and dove right in *(followed directions of course) and WAH-LA! Site moved to root directory. THANKS AGAIN!!!

Reply

September 7, 2012 at 4:16 pm

Hi Don

I can’t tell you how much I am grateful to you for having shared this video. I spent many hours and headaches trying to get it all sorted easily, and here you were!
THANK YOU SO MUCH and long life to Expand2Web!

Reply

matt September 12, 2012 at 6:30 am

thanks for this! I was doing it the manual way.
what a time saver!!!!!!

Reply

Brigitte September 25, 2012 at 8:29 am

Tks. This was really very helpful and easy to follow.

Reply

Aaron September 28, 2012 at 6:25 am

Hey Don, thank you so much for this very very helpful video. I have to help a friend of mine today in moving his wordpress installation and your video makes it seem very easy!

Reply

Anne Katzeff October 3, 2012 at 7:38 am

This is the best explanation I have seen regarding moving WordPress to its root directory. Clear, simple, well-paced. Thank you!

Reply

Juvy October 28, 2012 at 8:13 pm

Hello Don, I would like to ask help about my problem on my website. I got this
Parse error: syntax error, unexpected ‘<' in /home/mymovie/public_html/wp-content/plugins/facebook-social-plugins/widgets/like-button.php on line 2

Do you have an idea how i can fix this? Please kindly help me.

Sincerely,
Juvy

Reply

Don Campbell October 29, 2012 at 10:28 am

Juvy,
Try deactivating and reinstalling that plugin.

Reply

Ryan October 29, 2012 at 12:12 am

Your tip worked beautifully but now i get double forward slash after the index URL of the site, like so:

http://www.toohforeeec.eq.edu.au//wp-content/uploads/Figbird-Sphecotheres-viridis.jpg

It works, but this is not proper referencing, should I be concerned>?

Reply

Don Campbell October 29, 2012 at 10:29 am

Ryan,
Yes you should fix that – did you use the VelvetBlues plugin? You should run it again to remove that beginning forward slash.

Reply

Robert Sachristan November 2, 2012 at 8:50 am

Hi Don

I just can’t believe how easy this is presented in your video, almost too good to be true! I have tried mirroring a website but it still has some problems, I don’t know why it can’t be this easy as in your video.

I have a dev.subdomain.com at dreamhost, once I finish developing that I want to move it to the root, Im going to give this a try.

Reply

drew November 18, 2012 at 12:19 pm

Hi, great vid, thanks! What? about all the existing files I already have in the root folder? Should I move those out of the root before I move the wordpress site into the root? What happens when they are both in the root, does it create problems and a mess?

Reply

Don Campbell November 18, 2012 at 12:23 pm

drew – good question. What did you have installed in the root folder before? I would avoid deleting files from the root folder unless you know exactly what they are.

Reply

Drew November 18, 2012 at 12:48 pm

Hi Don,
I have my existing site in the root. It’s a flash site. If I move my new WP site to the root, how will the server know which site to display – the old site or the new site. I’m done with my old site and want to remove it.

Reply

Don Campbell November 18, 2012 at 12:51 pm

I see. First, back up the files in the root of your website.
When you copy WordPress into the root, it will copy a file called index.php into the root, and that should become the default file.

If not, you may have to get rid of the existing index.html file so that WordPress can become primary. It depends on how your host is set up.

But your hosting provider can help you with what they call the “default document” setting in your root folder. After the WordPress move you want it to be index.php.

Reply

Drew November 18, 2012 at 12:56 pm

Backup for sure! Sounds simple enough, just replace index.html with index.php. Thanks again Don. I’ll send you a link to my site when it goes live in a day or so.

Reply

drew November 19, 2012 at 6:40 am

Hi Don,
Need your help. I changed the urls in the admin panel, clicked save and received a 404 page not found error. So I’m not sure if the url’s indeed changed. Then I moved everything to the root directory and removed my old index.html file. Now I can’t see anything or access my admin panel to install the ‘update url’s’ plugin. Help!

Reply

Don Campbell November 19, 2012 at 12:33 pm

drew,
Try updating your wp-config file – it lives in the directory where WordPress is installed. You can use these instructions:

http://codex.wordpress.org/Changing_The_Site_URL#Relocate_method

Reply

Vicky Kennedy November 25, 2012 at 5:38 pm

Thank you SO much for this! Really helped me out – everything worked spot on!

Reply

Philip Wragg November 28, 2012 at 8:55 am

I have used this excellent tutorial a few times. For the first time today it has not worked and I get a blank screen when I log back into wp-admin now it has moved to root level. Any thoughts welcome!

Reply

Philip Wragg November 28, 2012 at 9:10 am

I can snow see wp-admin more a firefox issue perhaps – but home page not visible th ethemes are not showing in th ewp-admin

Reply

Mark Barrus December 12, 2012 at 12:58 pm

Don,

Thank you for explaining this so well.

Mark Barrus

Reply

jo December 20, 2012 at 8:13 pm

Hi Don, thanks for your instruction for moving the files to the main directory. It seems a very easy process but i guess not to me. :)
Ok, i did the first step: went to general settings and change the urls and website from kupuhawaii.org/development to kupuhawaii.org (right now what you are seeing is the old website at the main domain) and when i hit save suddenly it gives me an error message. Now i can’t even go the the admin and it always redirect me to the main directory.

Please help! thanks so much in advance!

Reply

Don Campbell December 20, 2012 at 8:39 pm

Jo,
Take a look at this, it will help you fix it:
http://codex.wordpress.org/Changing_The_Site_URL#Relocate_method

Reply

Leave a Comment

Previous post:

Next post: