Subdomain vs subfolder: where to put your blog (SEO)
blog.site.com or site.com/blog? What Google actually says, when a subfolder keeps links together better, and when a subdomain is the right call.
You decide the site needs a blog. You open the hosting panel and there it is: blog.yoursite.com or yoursite.com/blog? Half the articles you find swear a subdomain "kills your SEO"; the other half quote Google saying it doesn't matter. Both camps are partly right, and the part they leave out is the useful one.
This post separates what Google officially says from what people who have run both setups learn in practice, and ends with a concrete recommendation for the most common case: the blog of a product or company site. If your question is really about the domain extension (.com vs a country-code domain), that is a different layer of the decision, covered in .com vs .com.br: which domain to choose.
What a subdomain and a subdirectory (subfolder) are
A subdomain is a name to the left of the registered domain: blog.yoursite.com, app.yoursite.com, docs.yoursite.com. Technically it is another host. It has its own DNS record (usually a CNAME or an A record pointing to the blog's server — the post on DNS record types shows how to create one), it can live on a completely different server, and it has its own robots.txt.
A subdirectory, or subfolder, is a path inside the same host: yoursite.com/blog/, yoursite.com/docs/, yoursite.com/en/. Same DNS, same certificate, same robots.txt; what answers on /blog/ is decided by the server (or a reverse proxy in front of it).
| Aspect | Subdomain (blog.site.com) |
Subdirectory (site.com/blog) |
|---|---|---|
| DNS | its own record (CNAME/A) | no new record |
robots.txt |
one file per subdomain | one file for the whole host |
| Search Console | covered by the domain property; its own URL-prefix property if you want one | covered by the same property |
| Infra / CMS | can run on another stack with no effort | needs routing or a reverse proxy if the CMS differs |
| Internal links | must be cross-linked on purpose between hosts | natural: same navigation, same menu |
| Languages (i18n) | en.site.com |
site.com/en/ |
What Google actually says
This is where many posts (including the previous version of this one) overstate things. Google does not document that it treats subdomains as separate sites for ranking. The most quoted public statement is from John Mueller, in a 2017 Google Search Central video (YouTube): "Google web search is fine with using either subdomains or subdirectories." In the same answer he recommends picking a setup you can keep for a long time, because URL structure changes take a while to settle.
The official documentation says the same. In the guide to managing multi-regional and multilingual sites (checked 2026-11), Google lists subdomains and subdirectories as valid options, each with practical pros and cons: subdomains are "easy to set up" and allow different server locations; subdirectories are "low maintenance (same host)". Neither is described as penalized.
And the "domain authority" so many articles use as the argument? Domain Authority (DA) is a Moz metric, a score Moz itself says is not a Google ranking factor (Moz). It is useful for comparing link profiles, but "the subdomain has its own DA" says nothing about how Google ranks pages.
So why is the subfolder still the safer choice
Because the real difference is not an algorithm rule; it is what happens in day-to-day operation. Three practical effects:
Internal links happen on their own. A blog under /blog/ inherits the site's menu, footer and navigation. Posts link to product pages and back without anyone thinking about it. On a subdomain with another CMS, another theme and another team, those cross-links tend to be few — and it is the linking between pages, not the URL format, that lets Google understand both parts as one whole. Ahrefs reaches the same conclusion in its piece on the topic: whether a subdomain is treated as part of the site depends mainly on whether it is connected through internal links.
Backlinks to the blog help the site without a detour. When someone cites one of your posts, the link points to a URL that sits inside the same internal-link structure as your commercial pages. That can happen on a subdomain too, but only if you maintain the cross-links — and experience says nobody does.
Less surface for mistakes. One robots.txt, one sitemap per host, one certificate, one set of redirect rules. Each new subdomain is one more place to forget a staging noindex or a stale sitemap.
So the recommendation is based on practice, not documentation: for a content blog that supports a product, use a subfolder. Not because Google punishes subdomains, but because a subfolder makes it harder to get things wrong.
When a subdomain is the right choice
A genuinely separate product. app.yoursite.com for the logged-in SaaS and yoursite.com for marketing. Different audience, different stack, and the logged-in area shouldn't be indexed anyway. Same for docs.yoursite.com when the documentation has its own deploy cycle.
Infrastructure you can't unify. If the blog runs on a hosted platform that can only be attached to its own domain or subdomain, and you have no way to put a reverse proxy in front of it, a subdomain may be the only practical option. The right call then is to accept the subdomain and make up for it with real cross-links, not to stall the project.
Staging and preview environments. staging.yoursite.com should be password-protected or noindex. Blocking it only in robots.txt stops crawling but does not guarantee the URL stays out of the index if links point to it.
Per-country setups with independent operations. When each market has its own team, server and deploys, a subdomain per country is an option Google itself lists. Just don't count on Search Console to "tell" Google which country you target: the International Targeting report, which held that setting, was deprecated in August 2022 and removed in September that year. Today the signals are ccTLDs, hreflang and local content.
Robots.txt, Search Console and hreflang in each structure
A robots.txt applies only to the host, protocol and port where it is served. Google's documentation is explicit: a robots.txt on a subdomain is only valid for that subdomain. With a subdomain you maintain two files; with a subfolder, one — and you need to make sure a broad rule doesn't block the blog by accident.
# robots.txt on yoursite.com — the blog lives under the same file
User-agent: *
Disallow: /admin/
Disallow: /drafts/
# A "Disallow: /blog" here removes the whole blog from crawling
Sitemap: https://yoursite.com/sitemap.xml
To build the file without syntax mistakes, the robots.txt generator helps.
In Search Console, the difference is smaller than many articles suggest. A domain property (verified via DNS) includes all subdomains and protocols and aggregates their data. Only a URL-prefix property is limited to one host. So a subdomain doesn't "require" a separate Search Console setup; it just makes separating easy if you want to.
hreflang works the same in both models: each language version declares the others, with absolute URLs. This site, for example, uses a subdirectory per language (/pt/, /en/, /es/...) with hreflang on every page. The choice was pragmatic: one static build, one deploy, one robots.txt, and language routing handled inside the app. With six languages, six subdomains would be six more places to forget something.
Migrating from subdomain to subdirectory: is it worth it?
It depends on the reason. If the blog already lives on a subdomain, gets traffic and is well connected to the main site, migrating for SEO alone rarely pays off — Ahrefs, looking at real migrations (including mention.com's in 2016), found no clear gain attributable to the change of structure. The gains reported in case studies usually come bundled with other changes: more internal links, refreshed content, a redesigned site.
If you are migrating for another reason (one CMS, cutting a platform bill), do it properly:
blog.yoursite.com/post-x → 301 → yoursite.com/blog/post-x
- A 301 for every URL to its equivalent — never send everything to the homepage.
- Update internal links to point straight at the new URL, and check that title, description and canonical came along with the migrated pages — the meta tag generator is handy for checking the block before publishing.
- Submit the new sitemap and watch coverage in Search Console.
- Keep the redirects for at least a year; Google's site move guide recommends "generally at least 1 year" and says a small to medium site can take "a few weeks" for most pages to move, with ranking fluctuations along the way.
The details of redirects, canonicals and sitemaps are in the technical SEO checklist; no point repeating them here.
Frequently asked questions
Google said subdomains and subdirectories are equivalent. Doesn't that settle it?
It settles the algorithm part: Google doesn't penalize either structure and indexes both. It doesn't settle the operational part — internal links, how many files and properties you maintain, how many places something can break. That's why the practical recommendation for a blog is still a subfolder, without inventing a rule Google never published.
My CMS doesn't support a subfolder easily. Is the technical effort worth it?
If the blog is central to acquisition, a reverse proxy (Nginx, Cloudflare Workers, your host's rewrite layer) serving the CMS under /blog/ is usually worth the work. If the blog is secondary or the platform doesn't allow it, use the subdomain and invest in cross-links between blog and site.
Is a subdirectory per language (/pt/, /en/) better than a subdomain per language?
For most projects it is simpler: one host, one certificate, one robots.txt, hreflang inside the same app. Google lists both as valid. A subdomain per language or country makes sense when each market runs independently; it doesn't require a separate Search Console setup, because a domain property covers every subdomain.
How long until a migration shows its effect?
There is no guaranteed timeline. Google talks about a few weeks for most pages of a small or medium site; large sites take longer. A temporary dip during the transition is normal. A migration without 301s is a different story: the old links turn into 404s and their value is lost.
Pick the structure you can keep
For a blog that supports a product, use a subfolder: not because Google punishes subdomains, but because a subfolder keeps internal links, configuration and crawling in one place. Use a subdomain when there is a real separation — a logged-in product, docs with their own deploys, a platform that won't sit behind a proxy, per-country operations. Be suspicious of any article citing "Google documentation" to say a subdomain is a separate site; that documentation doesn't exist. And if the blog already works on a subdomain, migrating for SEO alone rarely justifies the risk.
- 01 Does the PageSpeed Score Affect SEO? 100/100 and Failing Google doesn't rank on PageSpeed's 0 to 100 score but on Core Web Vitals from real users. Here's why a site scores 100/100 and still fails in the field.
- 02 Unit test vs integration test: the difference in practice The difference between unit and integration tests with API and database examples: what each one catches, what it costs, and when to use each in your project.