One of the very first things you need to decide when setting up a new website or blog is whether to use www or no www in front of your domain. It’s a decision you need to take once in the beginning and stick to it for the lifetime of your website.
In this post, we will examine what is difference between having www in your URL and no www and what are the best practices when it comes to search engine optimization.
www vs no www
What is the technical difference between having www in your URL and not having www?
Let’s see a couple of examples:
URLs with www
- https://www.example.com
- http://www.example.com
URLs with no www
- https://example.com
- http://example.com
Domains with no www in front are also called naked domains. Domains with www can also act as a hostname which can sometimes be easier to manage when it comes to cookies, in cases where you have a number of subdomains assigned to the www domain.
This is a really technical thing which in reality won’t affect the majority of websites, so if you are having difficulties understanding what this means, just skip this explanation and move on to the big question.
Should I use www or no www in front of my domain?
The answer is simple. It depends on your personal preference. There is no SEO advantage from using one format or the other.
Three things are important:
First, to configure your website to ‘listen’ to only one of the variations (more on this below).
Second, to let Google and other search engines know what is your preferred choice.
Third, to be consistent and use the chosen variation when adding internal links to your content or when running link building campaigns.
Google considers http:// and http://www as two different websites
Why all the fuss about www and no www? Because Google considers these to be two different websites.
In other words, in the eyes of Google, http://example.com and http://www.example.com are two different websites and if you don’t specify which version you want to use, you will end up having SEO issues.
Let’s see how to set the preferred domain for your website and how to communicate your decision with Google so that you avoid and crawling and indexing issues.
Watch the video tutorial to learn the difference between www vs non www and how to set your preferred domain.
How to set your preferred domain in WordPress?
Login to your WordPress dashboard and then click GENERAL and then select SETTINGS from the left menu.
In the WordPress Address (ULR) and Site Address (URL), set your preferred domain.
In the example below, I have selected my preferred domain to have the www in front. As explained above, there is no advantage from doing so, it’s just a matter of personal preference.
How to test that your preferred domain is set correctly?
To test that WordPress can successfully redirect from one version of your domain to the other, perform the following test.
Open a browser window and type http://example.com, if your preferred domain is set to http://www.example, then the page should automatically redirect to http://www.example.com.
How to set the canonical URL of your domain?
The preferred domain is also known as the canonical domain. A canonical URL, in general, is a piece of HTML code that tells search engines, what is the canonical or preferred version of the page.
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 it helps to 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, it means that your theme is not SEO Friendly and it does not support it.
Don’t worry though, you can install the free version of Yoast SEO plugin and it will do this automatically for all your website posts and pages (including the homepage and archive pages).
What if I want to change my preferred domain and add or remove the www for an already established 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.
What happens when you migrate from http to https?
When you migrate your website to https, you should make sure that you keep the same format in Site Settings i.e. if your previous preferred domain was http://www.example.com, then change it to https://www.example.com and NOT to https://example.com.
Once the migration is completed, you need to ADD and VERIFY both https://www and https:// with Google Search Console and set your preferred domain to match your previous settings.
Conclusion
To www or no 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.
T I Antor says
Hey, Alex,
Another excellent stuff!
This post is really helpful for the new users and as well as me, because i have learned about the use of www and no www for a site. Thank you very much for sharing this useful post. Have agrat weekend!
Vipul Baldaniya says
This is a really great piece of content. I loved it.
You did a great job in explaining it. Keep up the great work!
Thanks for the share! @Alex
Saikat Ghosh says
Thanks for posting this nice article!!
I want to know that should I add canonical only on home page or on all pages?
Alex Chris says
Hi
On all pages.
Thanks
Vishwajeet Kumar says
Hello Alex,
Thanks for this detailed explanation on choosing www or Non www versions of website. Its solely depends on our personal preferences as you have said in this post. However I prefer to use WWW versions for my website and blogs. Thanks for sharing these great insights.
Have a great day 🙂
Vishwajeet
Kumar says
This is the great Important knowledge on the WWW, today I know where I’ve lacked for my website. I’ve discarded www version of my website. Today I’ve learned more important tips for my website.
Thanks for posting such technical sound topics!
steve says
We always used to suggest using www as a certain demographic would automatically add www to any domain you gave them, and older web platforms would add it automatically as well, but that seems less prevalent nowdays, so we have switched to recommending using the non www version, as long as you have a 301 set up.
I have a quick question about canonical tags. Some publishing platforms (notably medium) allow you to add a cross domain canonical tag, so you can republish your blog content on their platform, seemingly gaining additional exposure without any negative SEO consequences.
This looks like an attractive idea, but i am skeptical about how well it would work – do you have any experience with this?
Alex Chris says
Hi Steve
You can safely republish your content on other platforms (like medium), provided that you set the canonical URL to point to the original source (i.e. your website). If you do this for all the posts you republish, you have nothing to worry about SEO.
Hope this helps
Alex
Billy Konker says
Hi Alex, thanks for clarifying. We always use the naked url.
Billy K.
Alex Chris says
Hi Billy
Thanks for your comment. Having no www in your domain is just fine. It’s a matter of personal preference.
All the best
Alex
Kieron says
Thanks Alex for good solid overview on “to www or not”. I’ve directed a few clients to your blog already. This subject comes up more that you’d think. Helpful to have what we’ve been preaching confirmed. 🙂
Alex Chris says
Hi Kieron
Thanks for your comment. It’s true that a lot of website owners don’t know about this or just ignore it. But setting your preferred domain is important for technical SEO.
Thanks
Alex