One of the biggest 'arguments' in SEO is the subdomain vs. subdirectory debate. 

Which is better for SEO? Does it actually make a difference? If a blog is hosted on a subdomain, should you migrate it into a subdirectory? What's Google's stance on this?

These are just a few of the many questions commonly asked in the SEO community on social media, often met with differing responses.

And in this guide, we want to clarify the confusion and help settle the debate about 'subdomain vs. subdirectory.' We'll dive deep into the technical SEO considerations that you need to take and outline the instances when they make the most sense to use.
Specifically, we'll look at:

Understanding Subdomains and Subdirectories

Before we look at which is best for SEO, let's first take a quick look at the technical difference between subdomains and subdirectories.

Subdomain: blog.yourdomain.com
Subdirectory: yourdomain.com/blog/ 

Essentially, a subdomain is a child of the parent domain, and they are sometimes used for hosting:

  • Blogs
  • ecommerce stores (when these are part of a larger site)
  • Internationalization (different websites to target different markets)
  • Separate mobile sites
  • Quote forms 

Notice that in the subdirectory (also known as a subfolder) example, the /blog/ sits within the main domain. It's part of the main yourdomain.com website in the same way that any other page would be. For all intents and purposes, this is just another page on this website.

But a subdomain sits outside of the main domain; it sits within its own partition of the domain. In this example, it's being used to host a blog.

A subdomain will always sit before the root domain when looking at a URL, whereas a subdirectory will always sit after.

If you're currently not sure how many subdomains your site is using, or if it's using any at all, you can use the Semrush Site Audit Tool to view your site's structure, including any subdomains:

site crawl

Just make sure when setting up the tool that 'including all subdomains' is selected for the crawl scope.

include subdomains

Why is there such a significant debate in the SEO community between subdomains and subdirectories? And is one better than the other when it comes to ranking on the SERPS?

Monitor and Fix Technical Issues

with Semrush Site Audit

ADS illustration

Giving Context to the Debate

Let's clear one thing up; your website's structure significantly impacts your organic search performance. 

The choice between a subdomain or a subdirectory for certain areas of your site can help or hinder your ability to drive growth. But similarly, there are instances when it does make sense to host part of your site on a subdomain.

This is very much an 'it depends' scenario. It's important that you understand the different use scenarios and how they can impact your site's organic performance. 

So then, where does the confusion come from?

This debate is sparked by the fact that Google treats subdomains as separate entities to your main domain, largely because some websites place different content on subdomains that shouldn't really be associated with the main site. Or in some instances, those subdomains of the main domain are controlled by different people.

So, to go back to our example above:

  • yourdomain.com/blog/ is treated as part of yourdomain.com by Google's algorithm
  • blog.yourdomain.com is not treated as part of yourdomain.com, but as a separate entity

This means that the content (and its valuable assets, such as backlinks) hosted on a subdomain isn't being taken into account by Google's algorithm when ranking the main domain. 

It's almost as though the content hosted on the subdomain is hosted on an entirely different domain for ranking purposes, and thinking about it in this way can help it become a little clearer. 

While this may not sound like a good thing, sometimes it makes perfect sense for a subdomain to be seen as a separate entity to the main domain, especially when the subdomains should be seen as representing separate businesses or divisions.

Often a subdomain will be linked (either via a navigation menu or internal links) to the main domain, but sometimes it won't be. This is a key factor when deciding which route you should go down when setting up your website (or a new section of it).

What Does Google Say About Subdomains vs. Subdirectories?

It's definitely not a case of saying that subdirectories are good for SEO and subdomains are bad. It's not that simple.

But we need to understand where the different recommendations come from and how they compare with Google's guidance.

In the video below, Google's John Mueller took a dive into the subdomain vs. subfolder debate in a 2017 video. This advice hasn't changed between then and today.

In this video, John states that:

Google web search is fine with using either subdomains or subdirectories.

— John Mueller, Google

And also that:

We do have to learn how to crawl [subdomains] separately, but for the most part, that's just a formality for the first few days.

— John Mueller, Google

Subdirectories: The SEO Debate

If Google's saying that using subdomains is fine, then what's the problem?

To answer this, we need to recap on two of Google's top 3 ranking factors:

  • Content
  • Links

Just because Google states that it's fine to use either subdomains or subdirectories, that doesn't mean to say there aren't benefits of one over the other.

To put it another way:

Will you be penalized for hosting your site's blog content on a subdomain? No. But could that content (and any links) help your main domain rank better and earn more traffic if they sat there instead? Yes!

If content and links are split between a subdomain and the main domain, those two entities' overall 'authority' is lower than if everything sat on the main domain (using subdirectories).

That's why it's common to see an uplift in overall organic visibility and traffic (compared to the two viewed separately) when migrating relevant subdomains into subfolders on the main domain.

For example, just look at the example below shared by Andy Chadwick and the resultant growth when he migrated a blog (previously hosted on a subdomain) onto the main domain (now as a subfolder).

There are plenty of great success stories of significant gains seen when moving content from a subdomain into subfolders.

Just take a look at what happened when one of Stephen Kenwright's clients moved their blog from a subdomain to a subdirectory:

Or one of the many other examples that's regularly shared on Twitter. 

Let's not dismiss that these examples are all talking about migrating blogs from subdomains to subdirectories and that, by default, blogs are typically content-rich (often, most of a business's best content sits on a blog) and that blog content commonly earns backlinks. The subdomain, here, has both topical relevance and authority that's closely aligned to the main domain.

So what's happening here is that the subdirectory is inheriting the authority (from content and links) and relevance during the migration and, when this is combined with the existing authority of the main domain, the result is an increase in authority (and resultant organic visibility) that is greater than when the two are seen as separate entities.

Essentially, great content that's earning great backlinks will almost always contribute to better SEO results when hosted on a subdirectory rather than a subdomain.

Subdirectories: The Challenges

In an ideal world, you would have full control over whether subdomains or subdirectories are used for various areas of your site.

But the reality is that it's usually not quite that simple, and it's common that compromises must be made based on technical limitations.

These can include:

  • Not being able to set up international sites in subfolders (i.e., yourdomain.com/us/ and yourdomain.com/es/) 
  • Developers not wanting to host a WordPress blog on the same server as an ecommerce store
  • A desire to use a dedicated blogging platform rather than the built-in blog of an ecommerce platform
  • A quote form or other feature that is unable to sit on the same server as the main site due to being written in different coding languages

These are just a few examples of what decisions are necessary to use subdomains or subdirectories. 

As an example, Shopify forces you to use subdomains for international stores (de.yourdomain.com rather than yourdomain.com/de/), and using subdirectories isn't possible, whatever the benefits might be. 

Similarly, if you want to use a WordPress blog and your site runs on a CMS that doesn't support this on the same server (or give you access to do this). A developer will often suggest using a subdomain for ease (although it's sometimes possible to use a reverse proxy in this scenario). 

Subdomain or Subdirectory: Which is Right for Me?

One thing that's for certain is that there's still a lot of confusion on whether subdomains can harm your SEO efforts or not, as we can see in this recent tweet:

While the intention here is genuine, it shows that there's still a lot of division on whether or not Google treats these any differently.

For the most part, the SEO community agrees that if there are no technical restrictions, legal restrictions in different countries, etc., you should host content in a subdirectory rather than on a subdomain.

That said, you should also consider the context of this decision and what it is that you're considering hosting on a subdomain. 

If it's a blog or ecommerce store, then the preference should always be that this content is hosted in a subdirectory.

But if it's a quote form or content that's unlikely to add value to your site from either a relevance or topical perspective, don't just default to using subdirectories. 

If there's a reason to use a subdomain, then this shouldn't be ignored, and features like quote forms or even support centers (often behind a login screen) aren't going to harm your site's SEO potential if hosted like this. In fact, you'd likely see no difference using subdirectories in these instances. 


In most cases, a subdirectory takes preference over subdomains from an SEO perspective. However, there are considerations that you need to think about before making a decision.

Content such as your blog is an easy decision, but other types of content and site features must be considered alongside each option's pros and cons; it's not always an easy choice to make.

Just be sure to understand how your decision can impact your site's SEO performance and bring these justifications to the table when discussing the right way forwards with developers and other stakeholders!

Monitor and Fix Technical Issues

with Semrush Site Audit

ADS illustration
Author Photo
James BrockbankJames is Managing Director of award-winning digital PR and SEO agency, Digitaloft, and has been involved in search marketing since the mid-2000s. He‘s a regular writer on topics including link building, content marketing and ecommerce, having previously contributed to the likes of Search Engine Journal.
Subscribe to learn more about SEO 101
By clicking “Subscribe” you agree to Semrush Privacy Policy and consent to Semrush using your contact data for newsletter purposes
More about SEO 101
How to Use Header Tags and H1 Tags for SEOHeader tags and H1 tags make webpage content more user-friendly and are part of basic SEO best practices. There are different types of header tags, categorized by numbers, from H1 to H6. Each header serves a different purpose, giving search engine crawlers like Googlebot valuable information about that page. This guide focuses on how to use H1 tags to improve your SEO results.
May 31, 2021
7 min read
What Is an Infographic? (& How to Make One)Infographics can be an important, dynamic tool when it comes to sharing valuable information online. In this guide, we’ll share our best tips and tricks for creating an effective infographic.
7 min read