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

2

10

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?

Salonika answered 12/2, 2020 at 16:55 Comment(0)
E
6

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

Expander answered 12/2, 2020 at 18:41 Comment(2)
On a whim I just ran it through the W3C nu validator, and interestingly it seems to ignore rel entirely — not only did "home" and "asdf" raise no complaints, but sticking rel on other random tags (body, script, title) wasn't flagged either. There's a nice table of defined link types (all the "good" rel values) on MDN. Quite a few are allowed on anchors, actually.Salonika
Thanks @Andron, always great to learn something new. I suppose it is a valid attribute on anything, just won't serve any meaningful purpose, I should probably brush up on my knowledge on what it is allowed for other than the few recommended uses (obviously hadn't thought of things like next, prev etc!)Expander
S
2

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.

Susumu answered 12/2, 2020 at 17:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.