Rel Canonical Syntax
-
My IT department is getting ready to setup the rel canonical tag, finally. I took a look at the code on our test server and see that they are using a single quote in the tag syntax (see code block below). Should I be concerned? Will Google read those lines the same?
<link rel='canonical' href='[http://www.wholesalecostumeclub.com/easter-costumes/bunny-suits](view-source:http://www.wholesalecostumeclub.com/easter-costumes/bunny-suits)' />VS. **versus** <link rel="canonical" href="[http://www.wholesalecostumeclub.com/easter-costumes/bunny-suits](view-source:http://www.wholesalecostumeclub.com/easter-costumes/bunny-suits)" />
-
To quote W3C draft specification on HTML5
Attributes are placed inside the start tag, and consist of a name and a value, separated by an "
=
" character. The attribute value can remain unquoted if it doesn't contain spaces or any of"
'
```=
<
or>
. Otherwise, it has to be quoted using either single or double quotes. The value, along with the "=
" character, can be omitted altogether if the value is the empty string.The accepted convention is " but according to the standard both are supported.
P.S. Is a version of your site live, if so I would maybe like to blog about it as it is related to what we are doing in baby toddler items (looking at your avatar).
-
<link rel="canonical" href="<a class="external" rel="nofollow" target="_blank">http://www.sitename.com/</a>" /> would be correct. Don't forget the double quotes!
-
Double quote is the norm in HTML
-
I have used it like this and haven't had any issues<link rel="canonical" href=http://www.sitename.com />If you use wordpress - yoast seo plugin - does it the same way.Read this post it will clear your question
http://www.seomoz.org/blog/canonical-url-tag-the-most-important-advancement-in-seo-practices-since-sitemaps -
I agree with John... why chance it? It should be a piece of cake for them to set it up with conformity to the standard
-
I'm not positive about how they'll deal with it, but why take a chance? It won't be that hard for them to change it from a single to a normal quotation, especially since it's on your test server.
Better safe than sorry.
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
-
Quickview product modal - should I add rel=canonical to each URL ?
I have a quick view modal for all products on my website. How should I deal with these in the page set up eg. should I rel=canonical to the full product page and no-index in robots txt or are they ok in Googles eyes as they are part of the UX ?
Intermediate & Advanced SEO | | ColesNathan0 -
Link rel=next and prev validator?
Can I validate link next and prev markup for paginated content?
Intermediate & Advanced SEO | | Evan340 -
WooCommere Canonical links relating to products and subscriptions
Hello, Thanks for taking the time to have a read of this, I'm not quite sure of the best way to address this issue. I have a WooCommerce site with Products and Subscriptions, i.e subscribe to buy the product monthly. Because of the way WooCommerce works these are effectively two different pages, for example: https://formnutrition.com/plant-based-nutrition/form-superblend-plant-based-vegan-protein/ and https://formnutrition.com/plant-based-nutrition/superblend-protein-subscription/ Since the second is just a Subscription of the first (Product) it's basically exactly the same content. I'm not sure if I should make the canonical link of the Subscription point to the Product? I would prefer that customers find the Product first and don't want Google to think this is duplicate content. On the other hand it's not strictly duplicate content as they are two different things? Is there any advice or best practice on how to handle this? Many thanks, Damian
Intermediate & Advanced SEO | | damo_form0 -
Attribution of port number to canonical links...ok?
Hi all A query has recently been raised internally with regard to the use of canonical links. Due to CMS limitations with a client who's CMS is managed by a third party agency, canonical links are currently output with the port number attributed, e.g. example.com/page:80 ...as opposed to the correct absolute URL: example.com/page Note port number are not attributed to the actual page URLs. We have been advised that this canonical link functionality cannot be amended at present. My personal interpretation of canonical link requirements is that such a link should exactly match the absolute URL of the intended destination page, my query is does this extend to the attribution of port number to URLs. Is the likely impact of the inclusion of such potentially incorrect URLs likely to be the same as purely incorrect canonical links. Thanks
Intermediate & Advanced SEO | | 26ryan0 -
How use Rel="canonical" for our Website
How is the best way to use Rel="canonical" for our website www.ofertasdeemail.com.br, for we can say goodbye for duplicated pages? I appreciate for every help. I also hope to contribute to the SEOmoz community. Sincerely,
Intermediate & Advanced SEO | | ZZNINTERNETMEDIAGROUP
Amador Goncalves0 -
Should canonical links be included or excluded in a sitemap?
Our company is in the process of updating our sitemap. Should we include or exclude canonical links.
Intermediate & Advanced SEO | | WebRiverGroup0 -
Is it ok to use both 301 redirect and rel="canonical' at the same time?
Hi everyone, I'm sorry if this has been asked before. I just wasn't able to find a response in previous questions. To fix the problems in our website regarding duplication I have the possibility to set up 301's and, at the same time, modify our CMS so that it automatically sets a rel="canonical" tag for every page that is generated. Would it be a problem to have both methods set up? Is it a problem to have a on a page that is redirecting to another one? Is it advisable to have a rel="canonical" tag on every single page? Thanks for reading!
Intermediate & Advanced SEO | | SDLOnlineChannel0 -
Canonical tags and GA tracking on premium sub-domain?
Hello! I'm launching a premium service on my site that will deliver two fairly distinct user experiences, but with nearly identical page content across the two. I'm thinking of placing the "upgraded" version on a subdomain, e.g. www.mysite.com, premium.mysite.com. Simple enough. I've run into two obstacles, however: -I don't want the premium site crawled separately, so I'd like to use canonical tags to pull all premium.* back to their www.* parents. --How different can page content be before canonical tags backfire? --Is there any other danger in using canonicals across subdomains like this? -Less importantly: with Google Analytics, if I track against the subdomain my visits will split naturally, and it should generate a second cookie for a new registrant who crosses subdomains. I could also use a visitor-level custom var. Good idea? Bad idea? Thanks! -m
Intermediate & Advanced SEO | | grumbles0