When setting up a new website or blog, you must first decide whether to use www or non-www in front of your domain. You need to make this decision once in the beginning and stick to it for the lifetime of your website.
In this post, we will examine the difference between having www in your URL and non-www, explain why it matters, and outline the best practices for search engine optimization.
What Is The Difference Between WWW And Non-WWW?
The difference between www and non-www is mostly technical, but both will take visitors to your website.
WWW (World Wide Web): This is a part of your web address, like www.example.com. Technically, "www" is a subdomain of your domain. It used to be the standard for websites and is still common today.
Non-WWW (Naked Domain): This is your website without the www, like example.com. It is also called the apex or root domain. It looks shorter and cleaner, which is why many modern websites prefer it.
The two technical differences that matter are:
- DNS: Under the standard DNS rules, a naked domain can't use a CNAME record, while a www subdomain can. Some CDNs and hosting platforms rely on CNAME records to route your traffic, so a www address is easier to set up with them. Many DNS providers now work around this with ALIAS records or "CNAME flattening", so it is less of a problem than it used to be.
- Cookies: Cookies set on a naked domain are sent to all of its subdomains. If you run other subdomains (a shop, an app, a blog on a separate platform), a www address keeps your main site's cookies separate from them.
For most small and medium websites, neither difference is noticeable.
Does It Matter Which One To Use?
Which one you choose doesn't matter for SEO. What matters is that you choose one and use it consistently. Here’s why:
For search engines, https://example.com and https://www.example.com are two different addresses, even though they show the same content.
Imagine this: If both versions are live, search engines find two copies of every page. This is a form of duplicate content. Google says some duplicate content is normal and it's not a violation of its spam policies, but it will then pick which version to show in search results itself, and it may not pick the one you want.
Also, if some websites link to your www version and others link to your non-www version, the link equity from those backlinks is split between two addresses unless you connect them. You want all of it to go to one version of your website.
Which is Better?
Choosing between www and non-www is a matter of personal preference. Neither gives you a ranking advantage. Here is how they compare:
| WWW | Non-WWW | |
|---|---|---|
| Example | www.example.com | example.com |
| Pros | Works with CNAME-based CDNs and hosting; keeps cookies separate from other subdomains; instantly recognizable as a web address | Shorter and cleaner; easier to type, say and remember |
| Cons | Longer to type and share | Can run into DNS limits with some CDNs and hosts; cookies are shared with every subdomain |
| Best for | Large sites, sites with several subdomains, sites behind a CDN | Most small and medium websites and blogs |
Whichever you pick, what's important is to:
1. Decide which version to use: www or non-www.
2. Redirect the other version to your chosen one using a 301 redirect. This tells search engines that both versions are actually the same website, and they should only pay attention to your preferred domain.
3. Be consistent and use the chosen variation when adding internal links to your content or running link-building campaigns.
Why Don’t Many Websites Use WWW Anymore?
The www prefix is a leftover from the early web, when organizations often ran their website, email and file servers on different machines and named them accordingly (www, mail, ftp). Browsers now add or hide the prefix automatically, and most people never type it, so many newer websites drop it for a shorter address.
That doesn't make www outdated. Both styles are common, many large websites still use www, and you don't need to type www before a website address for it to work, as long as the site redirects one version to the other.
Best Practices
1. Set The Canonical URL of Your Domain
The preferred domain is also known as the canonical domain. In general, a canonical URL is a piece of HTML code that tells search engines what the canonical or preferred version of the page is.
Best SEO practices suggest that you have the canonical URL set for each and every page of your website.
To check if your theme sets the canonical URL correctly, open your homepage in a new browser window and then view its source code (right-click anywhere on the page and select View Page Source).
Search for the word ‘canonical’, and you should see a line like this:
<link rel="canonical" href="https://www.reliablesoft.net/" />
This indicates the canonical URL for the page and helps prevent duplicate content issues.
Repeat the above tests for all pages of your website.
If you cannot find the CANONICAL declaration in your HTML code, use a plugin or hire a developer to add it.
2. Test That Your Preferred Domain Is Set Correctly
Perform the following test to ensure your website can successfully redirect visitors from one domain version to another.
Open a browser window and type https://example.com. If your preferred domain is set to https://www.example.com, the page should automatically redirect to https://www.example.com.
If that's not the case, you need to set your 301 redirections correctly.
3. Use the Preferred Domain Everywhere
Even though 301 redirects will send visitors to the right version, it’s best practice to use your preferred domain everywhere you control it:
- Internal links (links within your own website).
- Canonical tags and your XML sitemap. Make sure you submit the sitemap for the version you chose.
- Your Google Search Console property.
- Ads, email campaigns, and your social media profiles.
Can I Add or Remove The WWW For An Existing Website?
You can, but there is rarely a good reason to. If you already have an established website, the safest choice is to keep your current preferred domain.
If you do need to change it (for example, to move behind a CDN that requires a www address), add sitewide 301 Redirects from every old URL to its new equivalent, update your canonical tags, internal links and sitemap, and add the new version to Google Search Console. Google recommends permanent server-side redirects for this kind of change. Expect some ranking fluctuation while Google processes the move.
Conclusion
To use www or non-www is a matter of preference. There is no SEO advantage from choosing one version or the other but once you choose the one you like, stick with it for the lifetime of your website.
When setting up a new website or performing a technical SEO Audit of an existing website, this is one of the first things to check.


