Are you thinking of moving a WordPress site sub-domain to a root domain? The process is fairly easy to follow, and there is a way to save your SEO rankings as well. In this article, we will show you how to easily move WordPress from subdomain to root domain with step by step instructions.
Transferring WordPress from A Sub-Domain To A Root Domain
A subdomain is an extension of your root domain name. For example, http://yourwebsite.example.com is a subdomain of example.com. In this case, example.com is the root domain.
Search engines consider sub-domains to be a totally different website. This is why you need to make sure that you properly redirect search engines to the root domain after the transfer. This will help you preserve search rankings after moving your website.
Unlikemoving a WordPress site to a new host or anew domain name, moving a site to root domain is a bit easier. This is because the two are usually hosted by the same hosting company.
Step 1: Create A Backup Of Your Site
You should always keep a backup solution installed on your website for automated backups. There are plenty of WordPress backup plugins that you can use to keep your WordPress content safe.
Once you have created a complete backup, make sure that you store it in a remote location or on your computer.
Step 2: Move Your WordPress Files From The Sub-Domain To The Root Folder
First, you need to connect to your website using anFTP client or cPanel’s file manager. Once connected, go to your subfolder location and download all your WordPress files to your computer.
Next, open the public_html folder of your root domain. Depending on how yourWordPress hosting environmentis set up, this folder could also be named www or after your domain name.
Now, you need to upload all WordPress files you downloaded earlier to the root directory.
Step 3: Change Your WordPress URL And Site URL Settings
Once you move the WordPress files, you will not be able to access the WordPress admin area on the root domain. Trying to login to the root website will send you back to the subdomainwebsite’s admin area.
To fix this, switch to the FTP client and go to the root directory of your domain name. Next, you need to edit the wp-config.php file and add the following lines just before the line ‘That’s all, stop editing! Happy blogging’.
Don’t forget to replace example.com with your own domain name. If you want your root website to use www then you will need to enter the URLs with www prefix.
Save your changes and upload the wp-config.php file back to your website.
You can now visit your WordPress site’s admin area on the root domain name.
Step 4: Update Your URLs
Your WordPress site has moved to the root domain, but there will be links inside your WordPress database pointing to the subdomain. Let’s fix that.
You will need to install and activate theVelvet Blues Update URLsplugin. Upon activation, you need to visitTools » Update URLs page.
On this page, you need to enter your subdomainURL next to the Old URL option and add your root domain to the new URL. Next, under the ‘Choose which URLs should be updated’ area, you need to check all options except ‘All GUIDs’.
Once you are done, click on the ‘Update URLs Now’ button to continue.
The plugin will now update all URLs in your WordPress database. This may take some time. Once finished, you will see a success message.
Step 5: Redirect All Your Sub-Domain Traffic To The Root Domain
Now that you have moved WordPress files, let’s make sure that your subdomain traffic is redirected to the root domain name.
Go to your subdomain folder and make sure that hidden files are forced to be visible. Your FTP client settings have an option to always show hidden files. If you are using cPanel File Manager, then click on the Settings button at the top right corner of the screen. This will bring up the preferences popup. You need to select ‘Show hidden files’ and then click on the save button.
If your subdomain folder already has a.htaccess file, then you can delete it and create a new one. Inside the new .htaccess file, you need to copy and paste the following code:
Truth be told, it’s difficult for a web application that doesn’t have some kind of identification, even if you don’t see it as a security measure in and of itself. The Internet is a kind of lawless land, and even on free services like Google’s, authentication ensures that abuses will...
Although data persistence is almost always a fundamental element of applications, Node.js has no native integration with databases. Everything is delegated to third-party libraries to be included manually, in addition to the standard APIs. Although MongoDB and other non-relational databases are the most common choice with Node because if you...