How to Change WordPress Multisite to Sub-Directories or Sub-Domains Without Errors
If you have ever set up a WordPress Multisite install and then decided to swap from sub-directories to sub-domains, or the other way around, you would know it’s not as simple as clicking a few buttons.
Unfortunately, the “Network Setup” page in the backend of Multisite doesn’t give you an easy way to switch. Yeah, it’s frustrating!
If you try to make the switch manually, it’s likely you’ll be met with errors that are somewhat difficult to decipher, and the WordPress Codex doesn’t clearly spell out the results to your search engine (read: Google!) ranking after making the change.
So in this post, we’ll go through the steps necessary to switch your sub-directory and sub-domain settings, and also explore the possibility of potential SEO risks when making the switch.
Sub-Domains vs Sub-Directories
Before you jump into changing your Multisite from a sub-domain to a sub-directory or vice versa, it’s important to understand the main difference between the two:
- Root domain — Main portion of a URL. For example,
- Sub-domains — Show up as somewhat of a prefix to a root domain. For example,
- Sub-directories — A folder inside the main site and domain’s folder. For example,
When you see a sub-directory, it can refer to a folder with content in it that’s directly related to the main site or it can be a separate site altogether.
You could set up a blog as a sub-site named “blog” within a Multisite network using sub-directories or you could have a blog archive page on a single installation of WordPress and both would have a domain that looks similar to this:
Potential Search Engine Impacts
Before making the switch from sub-directories or sub-domains, it may be important to note that there has been an ongoing debate on whether switching negatively impacts your search engine ranking.
Results in Your Rankings: Sub-Domains or Sub-Directories
Many advocates insist that switching from a root domain or sub-directory to a sub-domain results in a significant plummet to search rankings, specifically in Google. You can search Google and read case study after case study where this seems to be the case.
But does Google’s algorithms actually penalize the use of sub-domains or sub-directories if you make the switch? In a 2007 post, Google’s Matt Cutts explained that Google doesn’t mind whether your site uses sub-directories, sub-domains or a root domain since they’re all treated equally. He also reiterated this in a later YouTube video.
Impacts of Changing Your URL
Still, changing your site’s URL is tricky business. Google does mind if your URL changes in general and the impact could go either way.
For example, if you switch from a brand new domain to one that has been around for a long time, you could see a boost in your traffic. On the other hand, if the older domain has been used in the past to host spam, the chances of seeing a boost in traffic is slim to nill. You’re likely going to see a decline in your search rankings.
That’s why case studies can be deceiving. There are so many factors which could influence a switch from sub-directories or sub-domains that it’s difficult to create a case study in a vacuum so results aren’t skewed by outside factors.
There are also just as many case studies out there that show making such a change had no effect on rankings or even that there was a boost such as with our own WPMU DEV Blog.
Google also considers sub-domains to be a mostly separate site from the root domain while sub-directories are seen as being more or less directly related to the root domain. Keep in mind that there are exceptions so don’t use this as a hard and fast rule.
There are also ways to minimize the impact such as using 301 redirects. You can check out our post Creating Redirects for WordPress (and the Best Plugins for the Job) for details on that.
Which One is Best?
At the end of the day, choosing between a sub-directory or sub-domain installation for Multisite is completely up to your preference when it comes to ease-of-use, marketing and user experience. Choosing to switch between them alone isn’t going to be a determining factor for your Google search rankings.
Here’s a general guide for the reasons why you may want to use a sub-domain:
- You want to differentiate your new site from your old one while still showing they’re related
- You want to differentiate different regional locations for your business when each site has a lot of different content
- If you need to create a site that has a different focus, while still being related to your main site
- If you determine that it would be better for your site’s audience and user experience
- You find it easier for development purposes
Here’s why you may want to use sub-directories instead:
1.6 million WordPress Superheroes read and trust our blog. Join them and get daily posts delivered to your inbox - free!
- You need to display an overall sense of uniformity to show all your site’s content is related
- You know your sub-sites won’t have enough unique content to rank well as their own site using a sub-domain
- If it’s easier for site development
- Again, if you find that it would be better for your site’s audience and user experience
- You consider yourself to be less experienced in web development, marketing or SEO and can’t decide between the two
When it comes to choosing which one is best, there’s no real right or wrong answer. Choose the option that makes the most sense for you and your users. At the end of the day, quality content is the most important factor in determining your search rankings. For more details on this, check out our post 9 Obvious Things You Probably Don’t Know About WordPress SEO.
How to Make the Switch
There are two steps to switching from sub-directories or sub-domains. You need to edit your wp-config.php and .htaccess files.
You can make the changes in whatever way you feel most comfortable whether you use FTP, SSH and the command line to download a copy of these files for editing or you choose to make changes directly in cPanel.
Either way, be sure to create a complete backup of your site before continuing so you don’t lose anything if you make a mistake. With a backup in your back pocket, you can easily restore your site to its former glory.
To change from sub-directories to sub-domains, open your wp-config.php file and find this line:
true and save the document. If you decided to use FTP or SSH, upload this changed copy back to your server.
On the other hand, if you want to go from sub-domains to sub-directories, find and edit the following line in your wp-config.php file:
Be sure to change
false and save the file. Don’t forget to upload the file back to your server if you chose to use FTP or SSH.
Once you made one of those changes depending on your preference, go ahead and update your .htaccess file.
Visit your super admin dashboard and go to Tools > Network Setup. Copy the rules that are displayed for your .htaccess file and make those edits in your actual file, then save it and upload it back to your site if you chose to use FTP or SSH.
Keep in mind that if you have existing sub-sites with content and you decide to make the switch, only the URL’s for new sites will be updated automatically.
You can manually make the change for your other sites on the Info tab under Sites > All Sites in your super admin dashboard. You can check out The Complete Guide to the Site Options for WordPress Multisite Networks for details.
After you modify the URL, update your database to reflect the new link. You can use a plugin such as Search and Replace to make the necessary changes.
When it comes to deciding to switch from sub-directories or sub-domains, it’s completely up to you. There aren’t any ramifications when using one over the other, but changing your URL may have a negative or positive effect on your search rankings.
Regardless, the quality of your site’s content is the most important factor in determining your ranking in Google.
If you do decide to change your Multisite from sub-directories or sub-domains after all, now you know how to make it happen.