Almost everyone that has created a new website has asked themselves this question, “Do we use a domain name with www. or leave them off?” and often the decision made is due to personal preference, rather than asking “Is www. or non-www. better for SEO and website performance?”
In this blog we are going to look at the differences between www. and non-www. domains, why those differences matter and which version is better for SEO.
Terminology
Let’s start with defining the terminology. A domain URL can be either:
https://example.com/
https://www.example.com/
Domains that start with a www are called a “subdomain”. Indeed, any domain that contains characters before the main domain name is known as a subdomain. Examples include:
https://www.example.com/
https://blog.example.com/
https://region.example.com/
Domains that do not contain the www are called “root domains”. This reflects the fact that they only have the domain name. Other names you may see are “bare” and “naked”.
https://example.com/
Are they different?
While both www and non-www domains normally point to the same website they don’t have to. This means that the www version could point to website A while the non-www version points to website B.
This means that search engines, including Google, can’t assume that the two versions are the same website and therefore they will treat the two versions as separate entities.
In extreme cases Google may even see both versions of the website as duplicate content of each other which will have an impact on the website rankings and site performance.
Thankfully, if you do find yourself in this situation the fix is an easy one and is something that we will look at further down.
To read more about this topic – https://developers.google.com/search/blog/2005/12/www-vs-non-www-versions-of-site
Why use a www subdomain
The traditional way of setting up a domain URL is to include the www. Now, just because it’s traditional does not always mean it’s better but there are a couple of advantages in using a www subdomain.
Cookies Restriction
By adding a www subdomain to a website URL we are able to have more control of cookies. Your developer will be able to deploy different cookies and cookie settings on the various subdomains, rather than have one rule to cover the full domain, as is the case with a root domain.
To read more about this topic – https://www.spyfu.com/blog/www-vs-non-www/
Traffic overload protection
Larger websites can find from time to time that they have to deal with large volumes of traffic. This may be due to a marketing campaign, such as a popular advert or competition, or getting a brand mention on other media. Or, it could be due to malicious actors trying to do harm to a website through a Denial-of-Service (DOS) attack.
When this does happen a server can get overloaded and shut down. When using a subdomain the server can be redirected to another one. However, root domain websites that rely on a CDN provider can’t just redirect to another server which means that the website will go offline until the issue is resolved.
To read more about this topic – https://www.netlify.com/blog/2020/03/26/how-to-set-up-netlify-dns-custom-domains-cname-and-a-records/#options-for-bare-domains
Why use a root domain
Modern browsers don’t display the www anymore and many adverts remove them from a displayed domain as they know the visitor will get to the website with or without the www.
Over time, we expect this will become the norm and people will drop the use of www when talking or writing about website addresses making the inclusion of www unnecessary.
Stay Consistent
Perhaps the most important advice when looking at using either a www subdomain or just the root domain is to stay consistent. This means, if you already have a website set up on one version don’t just change for the sake of it!
Moving domain names, even when just changing from a www subdomain to a root domain, is a high risk venture. It requires site-wide redirects, updating Google Search Console and hoping that search engines both reindex the website on the new domain and carry over all the authority the old version had. It is much safer to keep the URL as it currently is; whether that is a www subdomain or a root domain.
Setting up Redirects
Your website should be accessible whether a visitor uses the www prefix or not. However, we need to make sure that we do not end up having two versions of your website, one version using the www prefix and the other not, as this will create duplicate content issues.
This means that whether you use the www subdomain or the root domain we need to ensure one redirects to another.
For example, if you favour the www subdomain you need to have the following redirects set up.
https://www.example.com/ – Primary domain
https://example.com/ – 301 redirect to the primary
However, it doesn’t end there. You also need to ensure that the unsecured http versions also redirect.
http://www.example.com/ – 301 redirect to the primary
http://example.com/ – 301 redirect to the primary
By having all versions redirecting to your primary domain you can be sure both search engines and people are able to access the correct version of your website.
Set up canonical links
To ensure you have all the bases covered we also recommend that you set up canonical links on your website that point to your chosen URL.
Canonical links are an HTML element that sits in the source code of a website that is designed to tell search engines where to find the primary version of your website or page.
For example, by including in the source code of your website you are instructing search engines that the primary version of your website is the www subdomain and all other versions should be ignored.
This will prevent any potential duplicate content issues caused by subdomain/root domain confusion or poor implementation.
If you are using WordPress then the CMS will automatically set the canonical links up for you. You just need to make sure you have selected the appropriate option within the WordPress settings.
Which is better for SEO?
As you can see from the above, there are a couple of technical advantages of setting your website up on a www subdomain. However, if your website is already live then the advantages of a www subdomain do not outweigh the disadvantages of changing your domain URL.
There is no great SEO advantage in one set up over another and as long as you have the correct redirects in place both search engines and real users will be able to get to your website regardless of whether you have a www subdomain or just use the root domain.
Get in Touch
If you want to talk about about how to best set up your domain, feel free to get in touch with our talented team of SEO experts. We take pride in staying up to date with the latest industry insights and best practices to help give your business a competitive edge in the constantly evolving digital landscape.