Understanding the rel Attribute: SEO, Security, and Privacy Best Practices

Share this article:

HTML rel attribute examples

The rel attribute in HTML <a> tags defines the relationship between the current document and the linked document. Certain values of this attribute can significantly impact SEO (search engine optimization) by controlling whether a link passes "SEO juice" (link equity) to the destination page. Additionally, the rel attribute plays a crucial role in user security and privacy when opening external links.

rel Values That Block SEO Link Equity

These values inform search engine crawlers that the link should not pass SEO authority to the destination page. In other words, links marked this way have minimal or no impact on the target page's ranking. Currently, Google treats these attributes as hints rather than absolute directives, though it generally respects them according to its algorithms.

rel="nofollow"

Description: The nofollow value tells search engines not to follow the link or pass ranking value (PageRank) to the destination page. A nofollow link is not treated as an endorsement of the target page.

SEO Impact: Using nofollow prevents passing SEO value (link juice) to external pages. Google doesn't associate your site with the linked page and theoretically doesn't pass ranking authority. Search engine bots will still notice such links but shouldn't follow them further.

<a href="https://example.com" rel="nofollow">Example Link</a>

rel="sponsored"

Description: The sponsored value indicates that the link is paid or sponsored, such as from advertisements, sponsored content, or other paid promotional forms. This signals that the link isn't a natural, editorial recommendation.

SEO Impact: A sponsored link doesn't pass SEO value to the destination page—it functions similarly to nofollow, indicating it shouldn't be treated as an organic endorsement. Google recommends using sponsored for paid links instead of the previously used nofollow. For backward compatibility, you can combine sponsored with nofollow to ensure all search engines understand it.

<a href="https://example.com" rel="sponsored">Sponsored Link</a>

rel="ugc"

Description: ugc (User Generated Content) indicates that the link comes from user-generated content—such as comments, forum posts, or guest blog posts.

SEO Impact: This attribute functions like nofollow—it informs search engines that the link isn't directly recommended by the site authors but by users, so it shouldn't pass "trust votes" for ranking purposes. It was introduced as a complement/alternative to nofollow to better identify links added by users.

<a href="https://example.com/forum-post" rel="ugc">User Content Link</a>
Note: You can combine these attributes in a single link by listing multiple rel values separated by spaces. For example: <a href="..." rel="nofollow ugc">...</a> marks a link as both user-generated and SEO-neutral. For sponsored links, the combination rel="nofollow sponsored" is often used for maximum compatibility across search engines.

rel Values That Enhance Security and Privacy

The second purpose of the rel attribute is to improve security for users clicking links and protect their privacy. This primarily concerns links opened in new tabs/windows (target="_blank"), where certain risks exist without additional safeguards.

rel="noopener"

Description: The noopener attribute prevents the newly opened window (tab) from accessing the originating page via window.opener. This protects against malicious takeover of the original page by the destination page (a tabnabbing or phishing attack). In other words, the new document can't execute scripts that might redirect or modify the content of the tab that opened it.

Purpose: Security. Using rel="noopener" is a security best practice—especially for links with target="_blank"—as it prevents potential phishing attacks where the new tab could replace the original page's content. Modern browsers may implement this isolation by default, but adding the attribute provides an extra guarantee.

<a href="https://example.com" target="_blank" rel="noopener">Secure Link</a>

rel="noreferrer"

Description: The noreferrer attribute makes the browser omit the HTTP Referer header when navigating to the target page—so the destination site doesn't receive information about the referring page (where the user came from). This protects user privacy by hiding the referring URL. Additionally, according to specifications, noreferrer also behaves as if noopener was set—meaning it automatically provides tab isolation whether or not you explicitly add noopener.

Purpose: Privacy and security. Using rel="noreferrer" protects privacy (it doesn't tell the destination site the URL of the referring page). This affects analytics—traffic from such links will appear as direct/none (entry without a referrer). Moreover, by disabling window.opener, this attribute also protects against attacks similarly to noopener. It doesn't affect SEO—search engine bots can still follow such links and index the target page; the change only concerns data passed between browsers.

<a href="https://example.com" target="_blank" rel="noreferrer">Anonymous Link</a>
Note: You'll often see rel="noopener noreferrer" used together for links opening in new tabs. This combination provides complete protection—it omits the referrer and blocks access to the opener object—even in browsers that might not fully support one of these values. While noreferrer alone includes noopener functionality, including both doesn't hurt and improves backward compatibility.

Comparison Table of rel Values and Their Functions

rel Value Description (Effect) Use Case (SEO / Security) HTML Example
nofollow Prevents search engines from following the link or passing PageRank (the link doesn't count as an endorsement) SEO (blocks passing SEO value to external sites) <a href="..." rel="nofollow">Link</a>
sponsored Marks a sponsored/paid link that shouldn't affect the target page's ranking (functions like nofollow) SEO (commercial links that don't pass ranking) <a href="..." rel="sponsored">Link</a>
ugc Identifies links in user-generated content; treated like nofollow—doesn't pass authority to the target SEO (external links added by users) <a href="..." rel="ugc">Link</a>
noopener Detaches the new tab from the parent page—window.opener is null. Prevents manipulation of the original page by the newly opened page Security (protects against tabnabbing attacks) <a href="..." target="_blank" rel="noopener">Link</a>
noreferrer Omits the referrer—the target page doesn't know the referring URL. Also functions like noopener (isolates context) Privacy and security (hides traffic source information, prevents opener exploitation) <a href="..." target="_blank" rel="noreferrer">Link</a>
Summary: By using appropriate rel attribute values, we can control whether external links affect search rankings (e.g., nofollow, ugc, sponsored block link equity) and enhance user security and privacy (noopener, noreferrer for links opening in new tabs). Proper use of these attributes is part of SEO best practices and web security fundamentals. All described values can be combined as needed—for example, rel="nofollow ugc noopener noreferrer"—to achieve multiple effects simultaneously. When configuring external links, consciously choosing these attributes helps both protect your site's SEO reputation and ensure user security when interacting with links.
Start implementing these rel attributes today to improve your site's SEO and security!

Sources: This article was created based on information available from Google Search Central documentation, industry blogs (Sempai), and MDN Web Docs.