Moving a WordPress website from a sub-directory to your root: hosted with GoDaddy
I read today about a person frustrated their WordPress install was placed in a sub-directory rather than their root folder.
Technical support at GoDaddy suggested they just create a redirect to the sub-folder. I agree this is the easiest and although it works the links/urls within the pages and posts will continue to use the sub-directory structure! So it could be confusing for others down the road.
I suggest you take a little time and just move your WordPress site to the root folder of your website. It’s not very hard, just a lot of steps detailed below. Yes you could mess up your site but the odds are unlikely. To be 100% sure make a backup of your database and login via FTP and copy your site to your hard drive. Worse case you’ll be able to recover but you shouldn’t need to worry.
Disclaimer – No Warranty!
If you are not 100% confident with the idea of moving files/directories, using file manager in GoDaddy, changing settings in WordPress don't even attempt this! The cost to hire an experienced person for this is much less than the frustration you’ll have made
The Process Overview
Basically, WordPress is installed in a sub-directory in your GoDaddy website. So we first need to go into WordPress and change the settings which tell it to use the sub-directory. We are changing https://yourblog.com/blog to remove the sub-directory /blog so your website url becomes https://yourblog.com. Problem is if you try to change WordPress after you move the files you’ll need to get SQL Database access to make changes and that gets really challenging!
So first you login to WordPress, change the URL, log in to GoDaddy File Manager, move the files and then fix any missing images or links.
Depending upon your theme you may lose your custom header, rotating images, background images etc.. It depends on how the theme was coded. When you move your website files the configuration files may not change automatically. Just have copies ready before you make the move and upload when you’ve moved the site.
Open a web browser and log in to your WordPress dashboard
Open a new browser or tab and login to your GoDaddy Account
2- Open a new browser window or tab and login to GoDaddy. Click on Hosting Manager in the left column
When the next window opens, in the top left click the button "Your Files."
This will open the online file manager which operates a lot like Windows Explorer or Mac Finder.
This is the directory and files you want to move to the root!
Warning number #2: If you are at all worried at this point don't go forward as you can really mess up your site from here on!
Go back to WordPress and prepare it for the move
At this point your WordPress install thinks it's now in the root but it's not!
At this point your WordPress site is broken and won't work... how scary but don't worry!
If you leave the above setting at 25 you risk not selecting all your files. If you see more than one page of files something is wrong.
You should have less than 50 files/folders in your site. If you have a very large site you may need to move files in two steps. The goal is to get all the files into the root directory.
NOTE: I’m assuming here your root folder is empty. If you have another WordPress site or website you’ll want to first make a sub-directory and move these files FIRST. Then copy your WordPress files!
Make sure you are copying your files into an empty HTML directory. There will be folders but you don’t want to try and overwrite an existing website!
When completed go back and check your original folder /blog or /wordpress and make sure it’s empty! If there are still files, select the remaining files and move them to the root folder and you’ll be fine.
You’ve done it time to test!
Now go to your browser and type in your root url/domain name and next you'll see your WordPress site appear!
Now you can log in and look around your site.
Clean up and testing
Depending upon your theme your site may work but your header or background or items may be broken? Some themes have special rotating images or if you have a custom background you may need to reset this. I’ve even seen some themes misplace your header file. Don’t worry the images are still there in your media library or your backup files. You may need to download and re-upload so the new url for the file is set.
Install the plugin Broken Link Checker and activate it. This plugin will scan your site and let you know of any links that are broken. WordPress will update your site links when you change the settings BUT it will not change any links you’ve placed inside of a post or page. Broken Link Checker will find the problem links and allow you to edit them. Just remove the reference to the sub-directory and save the link and you are good to go again!
IF you set up a GoDaddy re-direct you’ll have to disable that
IF your domain name is forwarded to a sub-directory you’ll have to change that.
If you get 404 errors or page not found double check your browser isn’t taking you to the old site.
If that’s not the case make sure your files got moved to the root folder.
If the folders were moved ok first try another web browser. If you use Firefox try Internet Explorer to make sure you don’t have your pages in the cache.
Maybe you didn’t save your WordPress settings? WordPress may still be trying to find the sub-directory and you’ve moved the files? You can change this in the SQL DB but that’s another long post!
If there’s no other hope you can copy your files from the root HTML directory back into your sub-directory and test again to see if WordPress works. If it does change your General>Settings url and save. Next, move the files back and you’ll be good to go.
Worse case reverse all we’ve done and go back to where you started but I hope you haven’t got this far to even read this 🙂
Any questions, comments or clarification just let me know!