Many people like to create and test a new version of their site in a subfolder so that it does not affect their main domain. Once completed, they will want to migrate the new site over to the root directory for the domain. This is very common with WordPress. Follow the instructions below as we guide you on how to do just that with the WordPress CMS. Click here to learn more about WordPress Hosting.

Make a Backup of your account

Before performing the following procedure, it is a good idea to make a backup of your account prior to making any changes. Learn how to make a backup here: Backup website files in cPanel.

Prepare your Wordpress installation for the move

Prior to physically moving the files, you will need to prepare the installation to accept the new URL name.
  1. Log into your WordPress Dashboard. For example.
  2. From the main dashboard, go to Administration -> Settings -> General.
  3. Next, look for the WordPress address (URI): and change it from ( to
  4. Lastly, look for the Site Address address (URL): and change it from ( to

Moving your Wordpress from a subfolder to your main folder

After you have made your backup, removed the site files from the builder, and prepared your wordpress files, it is time to move your WordPress to the primary folder.
  1. Log into your cPanel admin dashboard.
  2. From the main cpanel area, look for the Files category and then click on the File Manager tool. Ensure you select the checlbox entitled Show Hidden Files.
  3. Once inside the File Manager, you will want to navigate to the folder you have the WordPress site in. For example, a folder named wordpress.
  4. You will see a list of all the wordpress files and folders in the right hand panel. Highlight them all and click on the Copy icon from the menu toolbar across the top of the page.
  5. A popup will appear so you can enter the destination folder. Continuing with our wordpress folder example, it should show as public_html/wordpress. Remove the /wordpress from the destination path so that it simply displays as public_html. Click the Copy Files button.
  6. This will copy the files up to the public_html folder. Use the File Manager to navigate back to the public_html folder. (You can do this by clicking on the Up One Level button from the toolbar across the top of the right hand panel.)
  7. You should now see the same files as you have in your wordpress folder.
  8. You can now delete the old wordpress folder.

Log in and finish the URL details

  1. Log into your NEW WordPress admin dashboard. For example ( or
  2. Go to Administration -> Settings -> Permalinks and ensure the link structure is the same as your new URL.
Continued Education in Course WordPress
You are viewing Section 20: 329: Moving your Wordpress from a subfolder to the root directory
Section 19: 330: Finding the Network Administrator Interface for Wordpress MS
Section 21: 328: How to disable comments on new posts and pages in Wordpress

Support Center Login

Social Media Login

Related Questions

Here are a few questions related to this article that our customers have asked:
Moving your Wordpress from a subfolder to subfolder
Putting WP site in specific directory + moving to root directory later
WordPress site moved and now home menu doesn't work
I want to replace my existing website with a WP created website
Subdomain beta site move or no
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
2013-06-13 6:08 pm
Hello, thanks for this tutorial, my WP folder was in, and i already moved to Now the only issue is the attachment images, is pointing to, how can i do to change that to point to root? i can't make the step 8 because it will make Error 404.

I'm making some changes to move my websites to Inmotion Hosting Business Pro Plan.

Thanks in advance.
22,613 Points
2013-06-13 6:32 pm
Hello MnLGmz,

The changes you're needing to make for the content is in the database. The easiest thing for you to do is to actually export the database as an SQL file and then edit it - unless you're familiar with making update queries in SQL. I'll list the steps below for what you need to do to make the change using the export option (it's much easier):

1) Login to your Cpanel
3) Select your Wordpress database
4) EXPORT your Wordpress database as a SQL file. Make a copy and keep it as a backup.
5) Download the SQL file that was exported to your local computer.
6) The SQL file is a text file, so you can open it in something like notepad, and then run a FIND AND REPLACE. You will need to look for your OLD PATH and replace it with the NEW PATH. The Find and Replace function is built into the editor.
7)When you're finished, save the file. Don't change it to another file format - keep it as a .SQL file.
8)Upload it back to the server.
9)IMPORT the changed file back into your server using the PHPMYADMIN.

And that should change the path in the database for you! I hope this helps you with your problem. If you have any further questions or need further assistance, please let us know!

Arnel C.
2013-06-13 6:45 pm

Thanks for answer very quick. Is there any way to find this path making a search in phpMyAdmin?, its a little bit tricky for me, because i don't have knowledge with this.

Thanks in advance,
22,613 Points
2013-06-13 6:50 pm
Hello MnLGmz,

You can try going through each table one by one and then looking at the data. You would need to go through all of the tables that have the path and then making the change manually. Otherwise, you need to use an update query using MySQL. If you're not familiar with using MySQL, then follow the steps I have listed, and you will be able to make the change to the database very easily.

Arnel C.
2013-07-29 11:52 pm
Followed everything you mentioned here but still see the old site that was initially present in the root and do not see the wordpress site that was initially present in a subfolder - wordpressdev.
Do i have to remove the old files under root?
n/a Points
2015-01-23 3:26 am

Really Awesome  Very Helpful Article ....Thanx...admin

2013-07-30 12:07 am
I have done the phpadmin step also but still see the old site on the root domain, need your help
2013-07-30 12:15 am
Alright, I had to delete all files under public_html and upload the wordpress files, looks like that works!
2013-07-30 12:24 am
Another question, how to save wordpress theme options?
14,452 Points
2013-07-30 10:23 am
Hello aviator,

Thank you for contacting us. I am not exactly sure what your question is, but if you are customizing a theme, we have a guide here on using the Theme Customizer.

We also have a helpful guide on installing a new theme in Wordpress.

These articles are all part of our Wordpress Education Channel.

If you have any further questions, feel free to post them below.
Thank you,

2013-09-13 9:03 am
The best way to clean your MySQL DB after you move from dev. to production is to install a plugin called
WP Migrate db
It will search and replace all your directories in all locations, files, posts, tables, etc.
I've used it for my sites I've developed and once I get my site onlin, will post a link, recommend, and donate to them.

2013-09-14 9:32 pm
/*** Update ***. I gave the wrong plugin above.
Use this one
velvet blue works great to update your url before and after your move-

2013-09-21 4:09 pm
I am to "Step 8: You can now delete the old wordpress folder" but it won't let me.

I would like to simply rename it (instead of deleting it), but I get an access denied error, as if it's locked or still "running". I've tried via FTP and through an online interface. FYI, I have an IIS installation.

Is there something I can do to "unlock" this folder (or disable the old wordpress) so I can rename the folder?

Any help is greatly appreciated!

11,156 Points
2013-09-23 9:01 am
You may have some sort of permissions issue that is not allowing you to make changes to the file. Unfortunately, I don't have much knowledge of IIS as we only run Linux servers but either your hosting provider for the IIS server or Microsoft may be able to provide you with more information on the issue.
n/a Points
2014-03-15 3:09 pm it will be helpful.

n/a Points
2014-03-16 7:19 am

Just another reason that Wordpress sucks badly. The other one WP being totally incapable of doing complete exports with images, templates and everything. With this much software bloat, why couldn't anybody make WP easily movable, backupable and restorable?

11,156 Points
2014-03-17 9:16 am
Most CMSs, such as WordPress, Joomla, and Drupal will define your URL within it. This causes the additional changes to be made and is not something that is specific to WordPress.
n/a Points
2014-06-11 6:08 am


This a very useful article/tutorial, but I guess that there are other alternatives to the “manual” migration process.

I’ve seen several plugins like Duplicator that can help you migrate from server to server.

I’ve also developed another plugin for this, it’s a complete solution:

GoLive plugin has a lot of features:

Automatically Export the Database from Source Server Transfering the files via FTP automatically Auto-import Database in Remote/destination server. Update .Htaccess properly Update wp-config.php file on destination server with the new credentials. Replace the URLs in Database (Posts, Pages, Menus…), and keep auto-update serialized objects too.

I hope it helps someone.



n/a Points
2014-06-12 4:48 pm

I just install it to my root directory of <>ODosta</a> but I cannot cannot change my image path to root directory. please tell me how I can do it.

25,006 Points
2014-06-12 5:00 pm
Hello Ahsan,

Do you have specific images that you are referring to? The images that I checked on your site have paths starting from the home directory.

Kindest Regards,
Scott M
n/a Points
2014-07-05 1:18 pm

I followed this tutorial and the WP site is coming up fine, and can log in like normal so all is well EXCEPT the theme colors and background has changed back to default. So that didnt "move" with everything or something changed it.

I still have the subfolder with good design - but I cant log into that anymore either.

How do I get the theme, custom css, colors, skin to move to the root directory ?



9,968 Points
2014-07-06 3:26 am
Hey Paul,

Were you sure to copy everything from your /public_html/wordpress directory to just /public_html?

It also sounds like you could need to change the WordPress URL of your site if you forgot to change it prior to copying your WordPress site from a sub-folder to the root of your site.

A quick way to check is to place this highlighted code in your wp-config.php file:


// ** MySQL settings - You can get this info from your web host ** //

That should force things to load from the proper URL, as it's usually a bad link to a CSS stylesheet that causes display issues after moving. If that fixes it, follow the other steps from that guide to make it permanent and remove the settings from your wp-config.php file.

If that's not the problem, you might also have issues with content directly stored in the WordPress database using the sub-folder URL. In phpMyAdmin you could simply click on the Search tab and look for subfolder-name with at least one of the words and clicking on Select All and then Go.

Please let us know if none of that does the trick for you.

- Jacob
n/a Points
2015-04-06 4:28 pm

I recently moved my WP site from a subdomain/folder to the root. Now I'm wondering how to fix all the old broken links that I previously shared on my social media pages to (at the very least) redirect to my homepage. Thoughts? Thanks.

14,452 Points
2015-04-06 4:42 pm
Hello Lindsay,

Thank you for your question. I recommend using 301 Redirects to fix the broken links.

If you are not good with coding .htaccess files, it may be easier to use one of the many 3rd party plugins available.

Thank you,
n/a Points
2014-07-31 7:10 am
perfect. saved my life. perhaps explain how to do it with Filezilla rather than c-panel. Just found it a little easier to do it this way.
n/a Points
2014-08-20 5:50 pm
Include steps for multisite installation of wordpress
n/a Points
2014-08-21 9:57 pm

Folks ...Great info, moved without a glitch from subfolder to main domain > www.*****.cn

Did what I needed - thanks again


n/a Points
2014-09-09 8:57 am

Nice guide, i moved my site from folder to root, but now no mails sent from wp. Post notifications, registration mails, lost password mail, doesn't send at all. Any idea?

14,452 Points
2014-09-09 9:50 am
Hello Christ0fer,

Thank you for your question. In our guide on resetting your WP password via PHPmyAdmin, you can also update/view the Admin email.

In Step 5 of that guide, click Edit beside user_email to change it.

Feel free to post any additional questions below.

Thank you,
n/a Points
2014-10-30 5:51 am

nice for wordpress users and fans.

n/a Points
2014-11-12 8:46 am


i've completed everything fine till step 8 and my website is live showing all the wordpress stuff

but the next step where you said login to your new wordpress dashboard or that is giving error

22,613 Points
2014-11-12 9:43 am
Hello Syed,

Sorry for the problems with the Wordpress move. In order for us to help you, we need more information, please. If you can provide a URL that we could check, it would help us understand what's happening. It also helps to know if you're using any re-directs, plugins, or directory changes that may have affected the location of the WordPress Administrator. If you're not sure, then you may need to troubleshoot the WordPress plugins, or check the WordPress database for the setting used for the WordPress Administrator.

Please provide us a little more information and we can investigate the issue further.

Kindest regards,
Arnel C.
n/a Points
2014-12-09 1:15 pm

Thanx, Very Helpful Article , Everything is perfect after moving my site to the main root according to the article instructions.

n/a Points
2015-01-24 1:05 pm

I am not sure if I am missing a step in moving my WP files from a sub-directory in the root directory. There is a sentence that says removed the site files from the builder. How is this done? Currently I am at the step of backing up the files. I have not changed the URI or URL names yet

25,006 Points
2015-01-26 11:35 am
Hello PaulaC,

To remove the builder files, you would simply delete them manually from within the cPanel file manager.

Kindest Regards,
Scott M
n/a Points
2015-01-25 5:45 am
hello im My Site please unrevome the file directorye at please help me
25,006 Points
2015-01-26 11:28 am
Hello Shimanto,

I am not understanding what you are asking. Could you please respond with what it is you want to do step by step if possible?

Kindest Regards,
Scott M
n/a Points
2015-02-15 4:48 pm

very nice all that artilce , i read all and know what you want to say , and its will help me alot 

n/a Points
2015-02-23 5:46 pm

OK. Here is MY problem. I did everything EXCEPT delete the DEV folder (/test) The index page comes up. But when i click on another link OR try to Login, I get this:

Fatal error: Cannot redeclare jetpack_is_mobile() (previously declared in /home2/seamona/public_html/test/wp-content/plugins/jetpack/class.jetpack-user-agent.php:3) in /home2/seamona/public_html/wp-content/plugins/jetpack/class.jetpack-user-agent.php on line 59


Please help!!Everything is Broken now and I cant get it back!!

25,006 Points
2015-02-23 7:51 pm
Hello Maurice,

Are you able to get into the wp-admin area? Can you disable the plugin? You may need to disable them either in bulk, or using the same technique, disable the individual plugin folder.

Kindest Regards,
Scott M
2015-03-11 2:37 pm
I'm not really ease with wp, it's new for me. A quick question for you. I'm just starting the process and first problem when I tried to change the WordPress address (URI) and the Site Address address (URL). My adresses are and not I deleted /test at the end of both and when I saved, I received an error message:
Not Found

The requested URL /wp-login.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Any idea to help me? Thanks a lot!!
22,613 Points
2015-03-11 2:58 pm
Hello Melanie2496,

Thanks for the question. Actually, the error is normal. You're just missing some of the steps required to finish that change. The link following the SITE URL option goes to this tutorial: Giving WordPress Its Own Directory. If you follow the steps here, then it will work properly. Sorry, it's not too obvious in the Administrator - it's something that I wish WordPress would fix myself.

I hope this helps to answer your question, please let us know if you require any further assistance.

Arnel C.
2015-03-11 3:19 pm
Hi Arnel,
I ignored the error and continued the steps, but now seems to be worst...
The current website doesn't work, all my folders of wp are writing on the page:
Index of /


When I try to go on the administration of the new website, I have this error message:
Not Found

The requested URL /wp-admin was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

In cpanel (File manager) the former files have been replaced by the new from wordpress but when I go to my FTP nothing changed. Any idea?
22,613 Points
2015-03-11 3:41 pm
Hello Melanie2496,

It is difficult to determine what you've done based on what you're showing me. If you are an InMotion Hosting customer, can you please provide your domain name. We can look at the account then help you resolve issue you're facing. If you're not a customer of InMotion, then we need to go BACK and look at the steps provided in the WordPress Codec to determine where things went wrong.

Please give us a little information so that we can provide further assistance for this issue.

Arnel C.
2015-03-11 3:47 pm
Unfortunately I'm not a customer...
I'm totally lost, how to go back?
22,613 Points
2015-03-11 3:57 pm
Hello Melanie,

Your best bet is probably simply to reset, remove all of the current files and then re-install WordPress. Otherwise, you will need to backtrack and undo what you've just done. Get back to the point where all you did was change the Site URL. Once you have done that then you can refer back to WordPress's directions. I think that there was some misunderstanding with the directions starting at step 7.

Arnel C.
n/a Points
2015-03-25 6:51 am

After moving my website to my hosting server, the theme options won't save.

22,613 Points
2015-03-26 1:01 pm
Hello Don,

Sorry to hear you're having problems with saving your theme. Can you tell us if you're a customer? And if so, can you please provide the account information? It sounds like a permissions issue, but we can't what the problem is without looking at the account.

If you have any further questions or comments, please let us know.

Arnel C.

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

48 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!