Full answer
The rel attribute names the relationship between the current page and the linked resource. It works on link elements in the head and on a and form elements.
Values on link in the head:
stylesheetloads CSS.icongives the small image for the tab.manifestpoints to the web app manifest.canonicalnames the preferred address when the same content has several. Search engines use it as a strong hint.alternatepoints to another version. Withhreflangit lists translations:<link rel="alternate" hreflang="hi" href="...">. Withtypeit can point to a feed.preload,prefetch,preconnectanddns-prefetchare performance hints.prevandnextmark pages of a series, but major search engines no longer use them. Keep normal links in the page.
Values on anchors, in a space-separated list:
noopenerstops the new page from reachingwindow.opener. Current browsers apply it totarget="_blank"by default, but writing it is still common.noreferrerhides the referring address, and it also impliesnoopener.nofollowasks search engines not to count the link.ugcmarks links in user content andsponsoredmarks paid links. They can be combined.external,author,license,helpandmedescribe the target, andmeis used for identity links.
A rel value the browser does not know is ignored. relList.supports("preload") tells whether a value is supported for that element.
The canonical link gives the one preferred address. The alternate link names the Hindi version. The anchor carries four values, and its relList shows them as a list.
Use only values that you mean, since wrong values can send the wrong signal to search engines.
<link rel="canonical" href="https://example.com/courses/html" id="can">
<link rel="alternate" hreflang="hi" href="https://example.com/hi/courses/html" id="alt">
<link rel="icon" href="data:," id="ico">
<a href="https://example.org" target="_blank" rel="noopener noreferrer nofollow ugc" id="a">Comment link</a>Run in Chrome 156 (headless) as a page; the snippet is wrapped in a minimal HTML document with doctype, charset and viewport meta tag. Two full runs gave identical results, and the measured values in the answer come from them.
Key points
- canonical names the preferred URL.
- alternate with hreflang lists translations.
- icon and manifest describe the site to the browser.
- noopener and noreferrer protect the opener.
- nofollow, ugc and sponsored describe link trust.
Common mistakes
- Putting nofollow on all outgoing links without a reason.
- Forgetting that the canonical link must be an absolute, correct address.
- Using rel="prev" and rel="next" and expecting search engines to need them.
Follow-ups
- What is the difference between nofollow, ugc and sponsored?
- How can you test whether a rel value is supported?
Tips
- Split the answer into head values and anchor values.
- Name canonical, alternate with hreflang, noopener and nofollow.