Best Way How To Move WordPress From Subdirectory To Main Domain

Many web designers start a new website redesign project on the subdirectory of the existing website domain.
If you wish to move your WordPress website from a subdirectory (something.com/newproject) to main domain (something.com) then I bring you this “best way how to move WordPress from subdirectory to main domain”.

I have been doing this enough times to know what is the best process. If you are a beginner, it might be a bit confusing. There are too many tutorials over the internet and everyone says something else.

That is why I decided to show you the simple way how to move it and still stay sane šŸ™‚

1. Create complete backup of the current website




Before you proceed to anything, back up the entire current website, including the database. If you don’t know how to back up a website, install the free plugin UpdraftPlus and launch the backup. Make sure you will connect this plugin with the storage (in the settings) where your backup files will be sent.

Make a backup of your development website (on the subdirectory) as well.

This is a necessary step to ensure that your data are safe in case anything goes wrong.

2. Change the domain name and domain URL in the WordPress settings

Log in to your WordPress website (the development project/on the subdomain) and navigate to the SettingsĀ ā†’ General.Ā 

Change the domain and URL name from subdomain to the main domain. Literally just delete the subdirectory after the “/” and save the settings.

Best Way How To Move WordPress From Subdirectory To Main Domain, WordPress migration, how to move wordpress from subdirectory to root, how to move wordpress from subdomian to main domain, how to move wordpress website from subdirectory to main domain, WordPress website move, wordpress website migration, wordpress website subdirectory to main domain

After this, your website will be unavailable, but we will change it quickly.

3. Delete all folders from your public_html directory




Login to your web hosting account and navigate to the File Manager. If you know your login details to the FTP, then you can also use an online FTP client, but it is safer to do it through the web hosting account.

Once you are logged in to your FTP, navigate to the public_html – or any similar directory (“www”) where are stored files of your current, public, visible website.

Select ALL files except the folder which refers to your subdirectory where you have your new website.

Delete selected files. There should be only the folder of your subdomain website left.

Best Way How To Move WordPress From Subdirectory To Main Domain, WordPress migration, how to move wordpress from subdirectory to root, how to move wordpress from subdomian to main domain, how to move wordpress website from subdirectory to main domain, WordPress website move, wordpress website migration, wordpress website subdirectory to main domain

4. Move all files from subdirectory to the public_html




Now open the subfolder file and select all files in there. Once selected, click on the “move” action in the upper menu panel. There should be a pop-up window which asks to what path you want to move files to.

You should fill inĀ /public_html and click on the button “move files”.

Best Way How To Move WordPress From Subdirectory To Main Domain, WordPress migration, how to move wordpress from subdirectory to root, how to move wordpress from subdomian to main domain, how to move wordpress website from subdirectory to main domain, WordPress website move, wordpress website migration, wordpress website subdirectory to main domain

Once it’s done, navigate back to the public_html path. You should see that all files from subdirectory moved there. Your WordPressĀ development website has been moved to the main domain.

5. Repair old links




When you have been creating your website in the subdirectory, all your internal links,Ā and medias were naturally linking to the domain with a subdirectory.

After the moving process, these links will not repair automatically, you have to help them.

You could do it by simple SQL “flush” in the database, but let’s not burden you with more advanced steps.

Install the free plugin called Velvet Blues Update URLsĀ and open the plugin.
Update your domain URL with this plugin. Make sure to update all URLs so choose all of the checkmarks except the last one “update all GUIDs”.

Best Way How To Move WordPress From Subdomain To Main Domain

All done!

The plugin will do all the work nicely. Your site should be now moved correctly and should work without any errors.

Did you manage to move your site from subdirectory to main domain successfully?
Let me know in case you have any issues during the process, I will be happy to help.

Cover photo designed with the Freepik vector.


Was this post helpful to you? If yes, you can ā€œbuy me a coffeeā€ and help me to manage the costs of this website.

Thanks!

barbaria

Barbaria is a web developer, web designer, and travel blogger. She's obsessed with digital matters, especially creating websites. She also loves to learn new skills. Many of these skills she gained online through the tutorials. That's why she decided to share her own skills with others too. And help other people learn new things and fulfill their dreams.

One thought on “Best Way How To Move WordPress From Subdirectory To Main Domain

  • May 27, 2017 at 11:30 am
    Permalink

    You really make it appear really easy along with your presentation however I find this matter to be really something that I feel I’d never understand. It sort of feels too complex and very wide for me. I am looking forward in your subsequent put up, I’ll try to get the hold of it!

Comments are closed.