Wordpress & use of 'www' vs not for webmaster tools - explanation needed
-
I am having a hard time understanding the issue of canonization of site pages, specifically in regards to the 'www' or 'non-www' versions of a site. And specifically in regards to wordpress.
I can see that it doesn't matter whether you type in 'www' or not in the url for a wordpress site, what is going on in the back end that allows this?
When I link up to google webmaster tools, should i use www or not?
thanks for any help
d
-
Thanks Christopher.
Sorry I'm not quite sure what the code you have supplied is for? My site currently works fine with or without the 'www' - but does the code you have supplied acheive something else?
thanks
d
-
The issue is www.EXAMPLE.com and EXAMPLE.com are considered two different websites, and Google may split the links in if people are linking to both versions. A 301 redirect tells Google to assume all links are pointed at one version.
Your Question: I can see that it doesn't matter whether you type in 'www' or not in the url for a wordpress site, what is going on in the back end that allows this?
My Answer: This is not WordPress, it is your web host. Most LAMP webhosts will automatically server your website with our without "WWW". WordPress will create the links on the pages it creates to the one specified in your settings, but the site will come up weather or not you use "WWW."
To Address the Concern: Because you are using WordPress, you are probably on Apache, so add this to your .htaccess file in the root directory.
After:
END WordPress
Add:
Rewrite all old filenames RewriteEngine on
Options +FollowSymlinks
rewritecond %{http_host} ^EXAMPLE.com [nc] rewriterule ^(.*)$ http://www.EXAMPLE.com/$1 [r=301,nc]Test with and without "WWW." Test with a different browser.
-
Hi Joseph, do you run into any SSL errors by using absolute links especially with images? I hate when you get an error message on secure pages saying that some content is not secure would you like to see it... do you think leaving the http part out is a better idea for sites that have SSL pages, use something like www.mydomain.com instead?
Thanks!
-
Hello David,
When you install wordpress it installs the files which can be found with or without the www.
On the settings page you can add the www as the version you want to use.
What is going on in the back that allows this ? => ( .htacess file re-write rules)
Your host should have rewrite rule available via .htacess file This will rewite all the pages on the site to which ever version you choose.
then in your webmaster account choose the www. version as well.
Redirecting your site to one version or the other is going to reduce two versions of your site down to one version so you do not have duplicate content issues or penalties.
I always use the full url (absolute link) with the www.for several reasons below.
This should always be used in your links within your site and the code as well.
Absolute link example is = http://www.your-site-url.com
-
easier and faster for search engines to follow
-
safer when worried about site hijacking
-
works better in emails ( make sure a visitor gets to the right page)
-
better if your content gets stolen and the thief does not take time to check and fix all the code (i actually caught someone who stole one of my sites content this way )
If you use one version all the time you are also going to make sure you get all your link benefits to the right domain and not split between the two.
Some seo's and many web designers don't use the full url to save time and code bloat of the site. Myself as well as many other think the absolute link has added benefits.
I hope that helps.
-
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
What Tools Should I Use To Investigate Damage to my website
I would like to know what tools I should use and how to investigate damage to my website in2town.co.uk I hired a person to do some work to my website but they damaged it. That person was on a freelance platform and was removed because of all the complaints made about them. They also put in backdoors on websites including mine and added content. I also had a second problem where my content was being stolen. My site always did well and had lots of keywords in the top five and ten, but now they are not even in the top 200. This happened in January and feb. When I write unique articles, they are not showing in Google and need to find what the problem is and how to fix it. Can anyone please help
Technical SEO | | blogwoman10 -
Solved Should I consolidate my "www" and "non-www" pages?
My page rank for www and non-www is the same. In one keyword instance, my www version performs SO much better. Wanting to consolidate to one or the other. My question is as to whether all these issues would ultimately resolve to my chosen consolidated domain (i.e. www or non-www) regardless of which one I choose. OR, would it be smart to choose the one where I am already ranking high for this significant keyword phrase? Thank you in advance for your help.
Technical SEO | | meditationbunny0 -
Changing URL structure of site, including AMP - redirect AMP too?
So, I'm changing all the URLs of a site, including all its AMP URLs, I'll be redirecting all the normal URLs, but do I need to also redirect all the AMP pages?
Technical SEO | | alksfjasldfu934341 -
Custom hreflang tags in WP & using with Yoast
Hi My clients dev has added custom fields for adding hreflang tags to head of pages such as: "Rel Type", "The URL", and "Language Code" Am i right in thinking that until a different language/country version of the site is created these can remain empty or should they still be populated once added say with some sort of global reference or best left blank since will leave the head content global by default ? Also how important is it to add charset to the language code ? since seems optional ? Also this set up is on WP multi-site with Yoast and devs asked me the below: _One thing to note is that Yoast generates its own "canonical" tags - so if _
Technical SEO | | Dan-Lawrence
_you are going to use hreflang tags and canonical tags then you don't need to _
_add a canonical using the custom fields I have set up - Yoast has that _
sorted. _But if you are going down the route of NOT having any canonical tags - and _
_using a x-defult for the hreflang tags, I will need to try and suppress the _
_Yoast canonical tag so you can do this. Much depends on your approach and _
what you think is best. So how do i know if using canonicals or x-default, i take it best simplest to leverage Yoast and hence not add canonicals to custom fields ? Isnt x-default just for indicating language selectors/redirector not specific to 1 region? So long as havnt got those then good to proceed with Yoasts generated canonicals ? Cheers dan0 -
Webmasters tools - Need to update every time you add a new product/page to an ecommerce
Hi guys, I run an ecommere store and we are constantly receiving and uploading new products. Do we need to update the sitemap every time we upload a product? Google Webmasters tools shows that the number of URLs received is higher than the number of indexed URLs. They should match right? Thanks and regards
Technical SEO | | footd0 -
Preview not available in SERPS & Google Webmaster
Hi, I have a question regarding Google - for a site I am working on I cannot see Instant Preview, in my SERPS and also in Google Webmaster there is no blocked robot txt file and I can't figure out why I have screenshots for all my other sites? If anyone can help much obliged. L This is the site http://apexgenerators.co.uk/
Technical SEO | | lauratagdigital0 -
Internal search : rel=canonical vs noindex vs robots.txt
Hi everyone, I have a website with a lot of internal search results pages indexed. I'm not asking if they should be indexed or not, I know they should not according to Google's guidelines. And they make a bunch of duplicated pages so I want to solve this problem. The thing is, if I noindex them, the site is gonna lose a non-negligible chunk of traffic : nearly 13% according to google analytics !!! I thought of blocking them in robots.txt. This solution would not keep them out of the index. But the pages appearing in GG SERPS would then look empty (no title, no description), thus their CTR would plummet and I would lose a bit of traffic too... The last idea I had was to use a rel=canonical tag pointing to the original search page (that is empty, without results), but it would probably have the same effect as noindexing them, wouldn't it ? (never tried so I'm not sure of this) Of course I did some research on the subject, but each of my finding recommanded one of the 3 methods only ! One even recommanded noindex+robots.txt block which is stupid because the noindex would then be useless... Is there somebody who can tell me which option is the best to keep this traffic ? Thanks a million
Technical SEO | | JohannCR0 -
Using Thesis as blog platform vs. Tumblr
I read a lot of advantages by using Thesis as a platform for blogging, but I like the themes and other plugins from Tumblr. Are there equivalents at Tumblr to the Thesis benefits so I can go a head and go with Tumblr?
Technical SEO | | HyperOffice0