Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link rel="canonical" #2351

Closed
domenic opened this issue Feb 10, 2017 · 5 comments
Closed

Add link rel="canonical" #2351

domenic opened this issue Feb 10, 2017 · 5 comments
Labels
addition/proposal New features or enhancements document conformance

Comments

@domenic
Copy link
Member

domenic commented Feb 10, 2017

I was planning to use this today, went to the spec to look up the syntax and any usage notes, and found out that it's not there. It seems like something so useful and widespread should be in the list of link rels in the spec. For example we could say that it's only useful on link, not a/area.

It's already in http://microformats.org/wiki/existing-rel-values#HTML5_link_type_extensions which states it can be used on a/area, hmm. Maybe we should just leave it there? But why is canonical in the wiki and author in the spec?

See also https://en.wikipedia.org/wiki/Canonical_link_element

/cc @sideshowbarker

@domenic domenic added addition/proposal New features or enhancements document conformance labels Feb 10, 2017
@annevk
Copy link
Member

annevk commented Feb 11, 2017

Maybe @tantek has thoughts on this?

@tantek
Copy link
Member

tantek commented Mar 28, 2017

We have a stub of a spec: http://microformats.org/wiki/rel-canonical which technically anyone can login and edit (all contributions to microformats wiki are covered by CC0 + OWFa, similar to how contributions to Wikipedia are covered by their contribution license).

Update: IIRC @kevinmarks (who worked at Google when rel=canonical was first becoming a thing) has often had a lot to say about rel=canonical, when to use it instead of new rel values etc.

Kevin, want to take a crack at expanding http://microformats.org/wiki/rel-canonical with your thoughts on meaning, usage, when authors should use it, what should browsers, search engines, and other consuming applications do with it?

@tantek
Copy link
Member

tantek commented Mar 28, 2017

Also re: "something so useful and widespread should be in the list of link rels in the spec" what I remember is that we gave up trying to maintain an explicit in-spec list beyond what went into HTML5 because it became far more "formal" work than necessary. Hence the easy to edit registry instead. If there's a good reason to reconsider growing an explicit list in the HTML spec, I'm not against it, I'd just be curious about what reasoning has changed since we gave up doing that.

@kevinmarks
Copy link

I've updated http://microformats.org/wiki/rel-canonical with a more thorough description and discussion - further edits welcomed.

@sideshowbarker
Copy link
Contributor

I added a use counter to the W3C HTML checker to collect data on usage of rel keywords. That has so far recorded data on 1,268,156 unique documents checked. Based on that data, the table below ranks the keywords based on how often they were found among those 1,268,156 documents.

As the table shows, canonical was found in almost 32% of the documents checked, and that makes canonical the third-most-commonly-used rel keyword—just after stylesheet and icon.


Rank Keyword Number Percent
1 stylesheet 1060847 83.65%
2 icon 712571 56.19%
3 canonical 402446 31.73%
4 alternate 377532 29.77%
5 nofollow 296259 23.36%
6 dns-prefetch 162899 12.85%
7 pingback 139291 10.98%
8 next 83834 6.61%
9 search 78826 6.21%
10 bookmark 66861 5.27%
11 tag 66103 5.21%
12 prev 58764 4.63%
13 author 42907 3.38%
14 external 20615 1.63%
15 preconnect 17217 1.35%
16 noopener 10560 0.83%
17 preload 8370 0.66%
18 license 7220 0.57%
19 noreferrer 7078 0.56%
20 prefetch 4869 0.04%
21 help 2966 0.02%
22 prerender 760 0.01%
23 serviceworker 0 0.00%

sideshowbarker added a commit that referenced this issue Apr 6, 2017
This change adds “canonical” to the HTML spec as a standard keyword
allowed in the value of the `rel` attribute for the `link` element.

Fixes #2351
sideshowbarker added a commit that referenced this issue Apr 6, 2017
This change adds “canonical” to the HTML spec as a standard keyword
allowed in the value of the `rel` attribute for the `link` element.

Fixes #2351
sideshowbarker added a commit that referenced this issue Apr 6, 2017
This change adds “canonical” to the HTML spec as a standard keyword
allowed in the value of the `rel` attribute for the `link` element.

Fixes #2351
domenic pushed a commit that referenced this issue Apr 12, 2017
This change adds “canonical” to the HTML spec as a standard keyword
allowed in the value of the rel="" attribute for the <link> element.

Fixes #2351.
inikulin pushed a commit to HTMLParseErrorWG/html that referenced this issue May 9, 2017
This change adds “canonical” to the HTML spec as a standard keyword
allowed in the value of the rel="" attribute for the <link> element.

Fixes whatwg#2351.
inikulin pushed a commit to HTMLParseErrorWG/html that referenced this issue May 9, 2017
This change adds “canonical” to the HTML spec as a standard keyword
allowed in the value of the rel="" attribute for the <link> element.

Fixes whatwg#2351.
alice pushed a commit to alice/html that referenced this issue Jan 8, 2019
This change adds “canonical” to the HTML spec as a standard keyword
allowed in the value of the rel="" attribute for the <link> element.

Fixes whatwg#2351.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements document conformance
Development

No branches or pull requests

5 participants