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. It used to be the standard for websites and is still common today.
If your site has many visitors, using www can give you more control over handling things like cookies or managing traffic through a CDN.
Non-WWW (Naked Domain): This is your website without the www, like example.com. It looks shorter and cleaner, which is why many modern websites prefer it.
However, if your website becomes very large, it might have fewer options for managing technical things like traffic.
Does It Matter Which One To Use?
Yes, it does matter, and here’s why:
Google sees https://example.com and https://www.example.com as two different websites, even though they show the same content. This can create SEO problems if you don’t choose one version and stick to it.
Imagine this: If both versions are live, Google might get confused and think you have two websites with the same content. This is called duplicate content, and it can hurt your rankings in search results because Google won’t know which version to show.
Also, if some websites link to your www version and others link to your non-www version, your domain authority gets split between them. You want all that SEO 'link juice' to go to one version of your website, not be divided between two.
Which is Better?
Choosing between www and non-www is a matter of personal preference. There is no real advantage to choosing the one over the other. 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.
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 go to VIEW SOURCE (right-click anywhere on the page and select VIEW 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, 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. Update Internal Links to Use the Preferred Domain
Even though 301 redirects will send visitors to the right version, it’s best practice to ensure all internal links (links within your own website) point directly to your preferred domain.
Can I Add or Remove The WWW For An Existing Website?
This is highly NOT recommended. If you already have an established website then there is no reason for changing your preferred domain.
In case you do want to do this, you will have to add 301 Redirects to redirect traffic and links from one version of the domain to the other. Beware, that this might negatively affect your SEO performance. Only consider doing this, if it's really important.
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.