Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does rel="home" on an anchor tag (<a>) do anything helpful?

I see this a lot on site title links in WordPress themes (probably because Underscores does it and everyone copies that):

<a href="/" rel="home">Some Site Title</a>

I cannot find even a semi-authoritative statement anywhere that rel="home" on an anchor tag is used meaningfully today by any browser, screen reader, or other user agent. The only "official" documentation I've located is this draft specification from 2005 on the microformats.org site.

That doc proposes home as a valid value on both <link> tags in the <head>, as well as <a> tags. Using it on a <link> has some pedigree from HTML v3, and there's reference to it in the wild from 2002. But I haven't seen anything about the <a> tag usage.

So, is including it helpful for anything/anyone? Would I do better to use <link rel="home"> in the <head>, or is that obsolete too in 2020?

like image 865
Andron Avatar asked Feb 12 '20 16:02

Andron


People also ask

What is rel in anchor tag?

The rel attribute defines the relationship between a linked resource and the current document.

Is rel an attribute for anchor tag?

The rel attribute specifies the relationship between the current document and the linked document. Only used if the href attribute is present. Tip: Search engines can use this attribute to get more information about a link!

What does rel bookmark do?

The rel attribute defines the relationship between the current page and the linked page or resource. The rel="bookmark" value specifies the permalink (permanent URL) used for bookmarking. A title value can be added to provide a title to the bookmark link.

What is the most commonly used attribute in an anchor tag?

The <a> tag defines a hyperlink, which is used to link from one page to another. The most important attribute of the <a> element is the href attribute, which indicates the link's destination.


2 Answers

The rel="page" was part of an initiative to create permalinks (see section 'Permalink detection') as part of a standard in HTML 4.

However with HTML 5 it now has no purpose and does not offer any accessibility or SEO value. It also might not validate using W3C validator anymore (not tested).

rel="something" should only be used on <link> elements, with the exception of rel="noopener", rel="nofollow" or rel="noreferrer" on anchors (<a> tags).

Note - There may be other rel="" for hyperlinks but the two stated are the only ones I can think of, it is no longer valid to use it for page locations, bookmarks etc.

Update

Thanks to @Sean who pointed out in the comments other elements can accept rel="", however MicroFormats are not the preferred way of adding structured data according to Google and their development is not as full fledged as using https://schema.org and JSON+LD.

“We currently prefer JSON-LD markup. I think most of the new structured data come out for JSON-LD first. So that’s what we prefer.” - John Mueller

I am obviously incorrect in what I said as it is perfectly valid, however personally I would not bother and stick with what Google prefers apart from the few items I listed.

See @Sean's answer for a bit more info on the subject.

for clarity rel="" has no bearing on accessibility

like image 89
Graham Ritchie Avatar answered Sep 20 '22 17:09

Graham Ritchie


home isn't one of the allowed keywords explicitly defined by the current HTML spec as allowed values for the rel attribute. However, the spec goes on to state that:

Types defined as extensions in the microformats wiki existing-rel-values page with the status "proposed" or "ratified" may be used with the rel attribute on link, a, and area elements in accordance to the "Effect on..." field.

On that microformats page, home has the "proposed" status—so it is valid to use according to the spec.

There's a specific rel-home page within that microformats site that goes into more detail about the usage with examples. It makes the statement—

Opera browser supports rel="home"

—which would imply that Opera has some functionality tied to that usage, but it doesn't provide any additional details.

Summary: rel="home" is valid to use on a elements. It's benefits aren't clear, but it doesn't hurt to use it. The draft spec for it has been around since 2005, so there's bound to be some technologies that make use of it.

like image 30
Sean Avatar answered Sep 19 '22 17:09

Sean