Please take a look at my canonical tag - is it written right?
-
Hi there! I just changed the preferred domain settings from http://example.com to http://www.example.com and received a recommended action from Google: "Ensure that you specify the new host as canonical in all page links or sitemaps."
Could you please let me know if "the new host" is equal to "canonical" and if I have to include this tag into every page of my website ?
Thank you!
-
Thank you!
-
Unfortunately I'm not much of a coder, so I won't be able to guide you on the htaccess code piece. Regarding the Search Console items though, the tool treats every site that is setup as its own entity, which is why you need a country and XML for each. An example of why they do this because you might have different profiles for http://www.example.com/us and http://www.example.com/ca where the subfolder specifies the country. If they recycled the same info from each profile setup, the /ca site would be set to U.S. instead of Canada.
-
Thank you, Sean!
-
Logan,
Thank you very much for your advise! I figured out that it is going to be much of work going from page to page and set their canonicals:) Maybe updating my .htaccess will work out? I am wondering if that (please see below) would be the right thing to put in there?
RewriteEngine on
rewritecond %{http_host} ^example.com [nc]
rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc]Also, when I added the property (http://www.example.com) yesterday and set it as preferred domain, I was suggested to change the target country and submit a sitemap file for both http://example.com and http://www.example.com. I don't quite understand why do they want me to do that if the country and the sitemap are obviously the same?
-
Kirupa,
The syntax of your canonical tag is correct. However, there are a couple things you should know before you continue:
1- When Google says "Ensure that you specify the new host as canonical in all page links or sitemaps." it means they want to to update internal links and your XML sitemaps, so it's more involved than simply updating your canonical tag. Basically anywhere your URLs are referenced should be updated to reflect your new www-canonical URL structure.
2- You may have provided that one tag as an example, but DO NOT put that exact tag on every page of your site. Doing so would point search engines to the homepage of your site from any page they visit. Canonical tags are basically soft redirects that search engines follow, so when a bot sees a canonical tag on one page that points to another page, they leave and go to where the canonical is pointing them. Google will often de-index URLs that canonicalize to another URL, which I'm assuming you don't want
-
Hey Kirupa,
Short answer is that you're all good. The canonical is correct.
All the best,
Sean
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
-
Canonical link tag for https - any disadvantages for SEO?
Hi Mozzers, We have a website that has both http as well as https indexed. I proposed the solution of implementing a canonical link tag on all pages (including the login/secure ones). Any disadvantages I could expect? Thanks!
Technical SEO | | DeptAgency0 -
GWT Duplicate Content and Canonical Tag - Annoying
Hello everyone! I run an e-commerce site and I had some problems with duplicate meta descriptions for product pages. I implemented the rel=canonical in order to address this problem, but after more than a week the number of errors showing in google webmaster tools hasn't changed and the site has been crawled already three times since I put the rel canonical. I didn't change any description as each error regards a set of pages that are identical, same products, same descriptions just different length/colour. I am pretty sure the rel=canonical has been implemented correctly so I can't understand why I still have these errors coming up. Any suggestions? Cheers
Technical SEO | | PremioOscar0 -
How long does it take for Google for deindexing pages?
Hi mozzers, We just launched a mobile website(parallel) and realized that it created many duplicate content with desktop URLs. I decided to add name="robots" content="No index, No follow" /> to the entire mobile site. My only concern is that I am still seeing the mobile site indexed when it's been almost a week I added these tags. Does anyone know how long it takes google to deindex your content? Thanks
Technical SEO | | Ideas-Money-Art0 -
Why am I getting rel= canonical?
I'm getting 14 rel=canonical tags on my site. Could someone offer me an insight as to this is happening? http://cool-invent.com Thanks, Lorraine
Technical SEO | | coolinvent0 -
H1 Tag as Logo on the Homepage.
So I was working on a Genesis theme website where they have the H1 Tag as the Logo on the homepage. I wanted this changed because I always use my H1 tag to include a keyword I want to rank for. I was told by the Genesis Forum Manager that Yoast said the Logo should be the H1 tag on the homepage. (Yoast has a WP SEO Plugin that is very popular) That makes no sense to me, so I was looking for Opinions. Thanks,
Technical SEO | | netviper0 -
Canonical tag, CNAME and 301 redirect
I have a website with a couple of domains pointing to one IP address. Let's say I have two domains www.example.com and www.example.ca I also see during my SEO analysis that the example.com and the www.example.com (same for the example.ca and the www.example.ca) are triggering server responses. How do I deal with this issue for best SEO. Canonical links? CNAME, or 301 redirects? thanks
Technical SEO | | casper4340 -
Robots.txt and canonical tag
In the SEOmoz post - http://www.seomoz.org/blog/robot-access-indexation-restriction-techniques-avoiding-conflicts, it's being said - If you have a robots.txt disallow in place for a page, the canonical tag will never be seen. Does it so happen that if a page is disallowed by robots.txt, spiders DO NOT read the html code ?
Technical SEO | | seoug_20050 -
Yoast canonical SEO question
Hi I've installed Yoasts SEO plugin. I've just set it up as a campaign in SEOMOZ pro and i now see 14 notices about rel=canonical. I haven't added the rel=canonical myself and is in connection with the Yoast code on the site. Why does it do that and should i do something about it?
Technical SEO | | infocell0