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
https://example.com/ 200 https://www.example.com/ 301 -> https://example.com/ canonical, links, sitemap all use example.com
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
| Factor | www | non-www |
|---|---|---|
| Ranking effect | None documented | None documented |
| Looks | Traditional | Shorter, modern |
| Cookies | Easier to scope away from subdomains | Cookies may apply to subdomains |
| DNS setup | CNAME to a host is simple | Needs A records or flattening |
| Existing site | Keep what is indexed | Keep 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
| Where | What to match |
|---|---|
| Server redirect | 301 from the unused hostname and from http |
| WordPress address | Settings → General: WordPress and Site Address use the chosen hostname |
| Canonical tags | Absolute URLs with the chosen hostname |
| Sitemap | Only chosen-hostname URLs |
| Internal links | Chosen hostname |
| SSL certificate | Covers 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
Choose the hostname
Keep the one indexed today, or decide for a new site.
Confirm HTTPS covers both
Open both hostnames over https. Fix certificate warnings first (HTTPS and SEO).
Set WordPress addresses
Check Settings → General for WordPress and Site Address.
Add a permanent redirect
Redirect the other hostname to the chosen one at host, Cloudflare or .htaccess level. Use one place only.
Test all four versions
Check http and https, with and without www. Each should end on the final URL in one hop.
Update canonicals, links and sitemap
Confirm all use the chosen hostname, then submit the sitemap.
Examples (illustrative)
| Request | Expected |
|---|---|
| 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
| Symptom | Likely cause (my own diagnosis) | Action |
|---|---|---|
| Both hostnames load | No redirect | Add 301 from the unused one |
| Redirect loop | Plugin and CDN conflict | Keep one rule source |
| Certificate error on www | Certificate misses that hostname | Reissue with both names |
| Search Console shows duplicates | Mixed canonicals or links | Align 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
Leaving both hostnames live
Duplicate site.
Switching without redirects
Lose indexed URLs.
Certificate misses one name
Browser warnings.
Redirect chains
Slow and wasteful.
Wrong Search Console property
Missing data.
Mixed canonicals
Conflicting signals.
Related guides
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.
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.




