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 making a mistake a long the way. I’m all for learning new concepts but don’t push it! Click here to inquire about us making these changes for you.
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, login 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 login to your WordPress dashboard
1 – Login to your WordPress site then go to Settings>General and there you'll see “WordPress Address and Blog Address” and they will show the subdirectory after your domain name like /wordpress or /blog. For now leave this window open and go to step 2
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
In the next window on the right side click Manage Account under the words “Control Panel.”
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.
In the left column choose your root directory if it’s not already chosen and then in the right column double click to open the sub directory that holds your WordPress install like /blog or /wordpress.
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
Step 3: Go back to the window with your WordPress dashboard opened and now remove/change the /blog or /wordpress from the Settings>General tab and click Save Changes at the bottom of the page.
Your final URL should be your root directory not the sub-directory. This should be what you want the new website to resolve to. Again after removing the sub-directory click Save Changes at the bottom of the page.
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!
Step 4: Go back to your GoDaddy window with the file manager open. In the left column click the sub-directory folder with your WordPress files and directories in it. This will display your files in the right column.
Look close at the toolbar and there's a setting for “Page Size” set this to 50 so you can see all your files and folders in one window.
Now click the check mark next to Filename at the top of the folder list in the right box. It will check or highlight all your folders and files. You want it to say 28 of 28 files or 31 of 31 files so you know they are all selected.
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!
Next you select the Move icon in the very top toolbar and you'll be prompted to choose your root folder. Next in the left box you want to choose your root folder of your website and then click ok. Generally this is “html” and click ok.
File manager will now move your web files, directories, plugins, themes, etc. to the root of your 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 login 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 setup 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 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!
Reversing what you have done
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!
WordPress Web Design/Development and Digital Marketing Expert.
I take the confusion out of online marketing! SEO, Web Design, Social Media Management, Local Citations focused on conversions!
Contact me for your specific project needs!