How to Easily Move Your WordPress Blog from a Subdomain to a Primary Domain Subfolder: A Step-by-Step Guide for Small Businesses
Recently, we planned a move from blog.seocodex.com (sub domain) to secodex.com/blog (domain sub folder). As such, we are in the right place to guide our readers on how to plan this move so that some simple mistakes can be avoided at the onset.
This guide is meant for beginners and DIY entrepreneurs. This only can serve as cross-check list for small medium businesses who have a website developer. However, developer will not need to do some of these points as they can use FTP to back up and reinstate on new WordPress website.
Pre-requisites:
1. Access to Hosting Provider (GoDaddy in our case)
2. RankMath (our preferred SEO plugin)
3. Google Search Console
4. Screaming Frog
Backup your content from Subdomain
Most hosting providers keep a backup of your website. You can check on the hosting service provider that backup is available or not. Here’s how to check on GoDaddy. Go to your account and select Web Hosting (your domain.com) in My Products dropdown. Select manage hosting and access the Backups in the Tools Menu. As you can see in the screenshot, you will have backup and you can also download a quick backup. This step ideally should happen before the migration.
Other providers also keep backups; however you have to check on their website if it’s available or not. The process remains the same.
Making index of the Blog Posts from Blog Subdomain
If you have limited number of posts, you can make a list of URLs to be moved. In case of substantial number of blog posts, here’s what we suggest:
1. Get list of pages from WordPress: You can login to WordPress and make a list of URLs from the pages and posts section
2. Get list of pages from Google Search Console: You can download the list of pages from the Pages section of GSC.
3. Get list of indexed page from Google (manual). Just go to Google and type >site:blog.example.com. You will see list of all indexed pages from the blog.
Local/Staging Website:
You can copy all the blog posts from the sub-domain to your staging website and upload them. The new blog posts in your primary domain blog should mirror the blog posts on the sub-domain. Get all the blog posts on the primary domain and prepare a sheet containing old URL and new URL for correct mapping. This will help the website developer migrate in a correct manner. Push your website blog section to live after these changes.
Migration with RankMath
Once you have the new URLs, the next step is to map it to old URLs from the sub domain blog posts. You can do it individually by adding the respective old and new URL in the redirection panel of RankMath. Here are simple steps outlining how to migrate individual URL’s to their new destination.
Hover over RankMath and click on the Redirections button. Select Add New and choose source URL from the sub-domain blog post. In the destination URL, add the primary domain blog folder post link. The redirection type should be 301 as it’s a permanent move.
There will be some hits to your blog homepage. If you want to ensure that all hits to your sub-domain blog page (only home-page hits, and not other posts), you can also access .htaccess from RankMath. Here are steps outlining the process:
Go to RankMath dashboard, select Redirection Settings from the panel. On the left side bar, you will see Edit .htaccess option. You will see a warning that editing the .htaccess can break a website. It’s true however follow the steps correctly and there will not be any issue.
If you want only redirection for blog homepage to lead to primarydomain.com/blog, use the following code. What this will do is any requests for blog homepage only (blog.domain.com) will be redirected to domain.com/blog.
# Redirect both HTTP and HTTPS requests to blog.example.com homepage to https://example.com/blog/
RewriteCond %{HTTP_HOST} ^blog\.example\.com$ [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^ https://example.com/blog/ [L,R=301]
The Final Steps for Website Migration from sub-domain to sub-folder:
Let Google Search Console know that you have moved your address. Go to settings and choose change of address from General Settings. Just move the sub-domain to the primary domain.
Run another crawl with Screaming Frog:
To check whether all your URLS from sub-domain have moved, run a crawl on the sub-domain blog with the help of Screaming Frog. Enter the sub domain blog address and you will be able to get a crawl report.
Bonus Tip: Do check for internal links within posts.
If you still need help in the migration, you can reach out to us. We have technical team in place at an affordable cost to make the migration seamless.