// SEO plans from €35/hour or €395/month// from €35/hr · €395/mo Free SEO checker[email protected]+31 6 4555 9353
Free SEO audit
technical seo

WWW vs Non-WWW: Which Should You Use?

Your site can usually be reached at both www.example.com and example.com. If both load without redirecting, search engines see two sites with identical content. This guide explains how to pick one hostname, redirect the other, and keep every signal consistent.

  • Pick one hostname
  • Redirect the other
  • Align canonicals and sitemap
  • Check Search Console
hostnamesone canonical
https://example.com/      200
https://www.example.com/  301 ->
                          https://example.com/

canonical, links, sitemap
all use example.com
// quick answer
Neither version ranks better. Google’s duplicate URL documentation gives the example of one page reachable at several hostnames, including a www and a non-www version, and recommends choosing one as canonical and redirecting the others to it. Pick one, send a permanent redirect from the other, and make canonicals, internal links and the sitemap use the same hostname.

The problem: one site, several addresses

A site can be reachable at four versions: http://example.com, http://www.example.com, https://example.com and https://www.example.com. Only one should be the final address. The others should redirect to it.

What Google says

Google’s consolidate duplicate URLs page uses a page reachable at several hostnames, including a www hostname, as its example, and says to choose one as the canonical and use redirects to send the others to it. It says redirects are a strong signal that the target should become canonical, and that Google generally prefers HTTPS over HTTP. It does not say www or non-www is better.

How to choose

Factorwwwnon-www
Ranking effectNone documentedNone documented
LooksTraditionalShorter, modern
CookiesEasier to scope away from subdomainsCookies may apply to subdomains
DNS setupCNAME to a host is simpleNeeds A records or flattening
Existing siteKeep what is indexedKeep what is indexed

For an established site, keep the version already indexed. Switching means redirecting every URL (see the website migration checklist). For a new site, pick the one you can set up cleanly and stay with it.

Signals to keep aligned

WhereWhat to match
Server redirect301 from the unused hostname and from http
WordPress addressSettings → General: WordPress and Site Address use the chosen hostname
Canonical tagsAbsolute URLs with the chosen hostname
SitemapOnly chosen-hostname URLs
Internal linksChosen hostname
SSL certificateCovers both hostnames so redirects work over HTTPS

Search Console properties

A Domain property covers all subdomains and protocols, while a URL-prefix property covers only the exact prefix you enter. If you use URL-prefix properties, add the version you chose. See domain vs URL prefix.

Step by step: set up one hostname

1
decide

Choose the hostname

Keep the one indexed today, or decide for a new site.

decide
2
ssl

Confirm HTTPS covers both

Open both hostnames over https. Fix certificate warnings first (HTTPS and SEO).

certificate
3
wordpress

Set WordPress addresses

Check Settings → General for WordPress and Site Address.

Settings
4
redirect

Add a permanent redirect

Redirect the other hostname to the chosen one at host, Cloudflare or .htaccess level. Use one place only.

5
test

Test all four versions

Check http and https, with and without www. Each should end on the final URL in one hop.

6
align

Update canonicals, links and sitemap

Confirm all use the chosen hostname, then submit the sitemap.

Examples (illustrative)

RequestExpected
http://example.com/page/301 to https://example.com/page/
http://www.example.com/page/301 to https://example.com/page/
https://www.example.com/page/301 to https://example.com/page/
https://example.com/page/200, self canonical

Notes for WordPress sites

  • The WordPress Address and Site Address already push most redirects. Check that both fields match your choice.
  • Do not use both a plugin redirect and a Cloudflare rule for the same job; they can create loops.
  • After changes, clear page cache and Cloudflare cache.
  • Search and replace old hostnames in content if you migrated; mixed internal links waste crawling.

Troubleshooting

SymptomLikely cause (my own diagnosis)Action
Both hostnames loadNo redirectAdd 301 from the unused one
Redirect loopPlugin and CDN conflictKeep one rule source
Certificate error on wwwCertificate misses that hostnameReissue with both names
Search Console shows duplicatesMixed canonicals or linksAlign signals

Checklist

Choose

  • Keep indexed version
  • Check DNS
  • Check SSL
  • Plan migration if switching

Redirect

  • 301 unused hostname
  • http to https
  • One hop
  • One rule source

Align

  • WordPress addresses
  • Canonicals
  • Sitemap
  • Internal links

Monitor

  • Search Console
  • Crawl for mixed links
  • Check after updates
  • Log changes

What Google’s page does not say

Google’s documentation says to choose one hostname and redirect the others, and that redirects and HTTPS are signals. It does not say which hostname is better, and it does not provide a DNS or cookie comparison. Those comparisons, the examples and the WordPress notes are my own practice.

Key terms

Hostname
The domain part, such as www.example.com.
Apex domain
The bare domain without www.
301
Permanent redirect.
HSTS
Header that tells browsers to use HTTPS.

Common mistakes

mistake 1

Leaving both hostnames live

Duplicate site.

Redirect one.
mistake 2

Switching without redirects

Lose indexed URLs.

Redirect all URLs.
mistake 3

Certificate misses one name

Browser warnings.

Cover both.
mistake 4

Redirect chains

Slow and wasteful.

One hop.
mistake 5

Wrong Search Console property

Missing data.

Use Domain property.
mistake 6

Mixed canonicals

Conflicting signals.

Match hostname.

Related guides

faq

WWW and non-WWW questions

Is www better for SEO?

No. Google does not say either version ranks better.

Can I use both?

Not as separate sites. Pick one and redirect the other.

Does Google prefer HTTPS?

Generally yes, if there are no conflicting signals.

Should I switch hostnames?

Only with a clear reason. Switching requires redirecting every URL.

Which redirect type?

Use a permanent redirect when the move is permanent.

Do I need a canonical too?

Yes. Add a self-referencing absolute canonical on the chosen hostname.

How do I test it?

Open all four versions and confirm each ends on the final URL in one hop.

What about Search Console?

A Domain property covers all versions; a URL-prefix property covers one.

sources

The hostname example, redirect and HTTPS statements follow Google’s documentation. The cookie and DNS comparison, examples, troubleshooting and WordPress notes are my own practice, and the Search Console property description is general knowledge to verify in your account.

Scroll to Top