Sub topic 6
nofollow, sponsored, and ugc: telling search engines how you relate to a link
This chapter covers the rel attribute values that tell search engines how a site relates to a link it publishes. It assumes you can read simple HTML, know what a URL is, and know that search engines crawl and index pages. It builds on the earlier chapters on link anatomy, crawling, and links as votes.
Why link attributes exist
Earlier in this tutorial you saw that a link works like a vote: when page A links to page B, a search engine may treat that as a sign that B is worth attention. That idea has a weakness. Anyone who can place a link can try to cast a vote. Spammers post links in blog comments, and businesses pay for links in articles. If every link counted the same, rankings would be easy to manipulate.
In 2005, Google and other search engines introduced rel="nofollow" so that site owners could mark a link as one they do not vouch for. Two more values followed in 2019: sponsored and ugc. Together they let a publisher describe the relationship between its page and the target, so the search engine can treat the link accordingly.
The attribute is set by the site that publishes the link, not by the site that receives it. This matters when you audit links later. You do not control the attributes on your backlinks, but you do control the attributes on the outgoing links you publish.
The four cases
A link has no special rel value by default. The table below shows the four cases you will work with.
| Link | `rel` value | Meaning | Typical use |
|---|---|---|---|
| Default | none | The publisher vouches for the target. | Editorial links in your own content |
| nofollow | `nofollow` | The publisher does not vouch for the target and gives no endorsement. | Links you cannot or will not vouch for |
| sponsored | `sponsored` | The link was paid for or is part of an advertisement or sponsorship. | Ads, paid placements, affiliate links |
| ugc | `ugc` | The link sits in user-generated content. | Comments, forum posts, user profiles |
The values are not exclusive. The rel attribute accepts a space-separated list, so one link can carry several values.
<!-- Paid placement -->
<a href="https://example.com/product" rel="sponsored">Partner product</a>
<!-- Link in a user comment or forum post -->
<a href="https://example.com/post" rel="ugc">A commenter's link</a>
<!-- Several values can be combined -->
<a href="https://example.com/offer" rel="sponsored nofollow">Offer</a>Default links
A link with no rel value is an ordinary editorial link. By publishing it, you tell the search engine that you consider the target worth a reader's attention. This is the kind of link that carries the most weight as a vote, and it is the kind that link-scheme policies are written to protect.
nofollow
nofollow is the oldest value and the most general. It says that you do not endorse the target. Use it when you link to a page you want to reference but not support, or when you cannot vouch for the target for some other reason. Examples include a link to a site you are criticizing, or a link inside content you did not review.
sponsored
sponsored marks a link that exists because of money or another exchange of value. This covers advertisements, paid placements, sponsored posts, and affiliate links. Free products given in return for a link count too. If a payment or a deal produced the link, sponsored is the accurate label.
ugc
ugc stands for user-generated content. It marks links that visitors, not the site's editors, put on the page. Blog comments, forum threads, and community profile pages are the usual places. The label tells the search engine that the site owner did not choose the link, so the site is not necessarily vouching for it.
How search engines treat these values
In September 2019, Google announced that it would treat all three values as hints rather than strict directives. Before that, nofollow was a directive: a search engine that honored it would not pass ranking credit through the link and would not use it to discover the target. After the change, the engine may still use the link for its own purposes. These can include crawling the target, or giving the link some weight when its systems judge that useful.
Three practical consequences follow:
- Do not assume a
nofollowlink is invisible to a search engine. It can still show up in the backlink reports you read, and it can still lead a crawler to a new page. - Do not assume a
nofollowlink is worthless to the target. A link in a well-read article can send real visitors to your page, which has value apart from ranking credit. - The engine may ignore your hint and decide for itself. This is rare for clearly labeled links, but you should not build a plan that depends on exact behavior.
Other search engines have their own policies. Check the documentation of each engine you care about instead of assuming they match Google.
Choosing the right value
The right value depends on why the link is on the page. Work through the questions in order.
Some cases need more thought:
- Affiliate links. You earn a commission when readers buy, so the link exists partly because of money. Use
sponsored. Addingnofollowas well is harmless and common. - User links you moderate. If your editors review and approve a comment, the link is still user-generated.
ugcremains accurate. If your editors adopt the link into their own content, treat it as an editorial link. - Widgets and embeds. Third-party widgets that insert links on your pages can leave you vouching for links you never chose. Review what they output.
- Guest posts. If you accept a guest article, the author's link is a link you chose to publish. If money changed hands, it is
sponsored. If the author wrote it only to place a link, considernofollow. - Internal links. Links between pages on your own site do not need these values. Adding
nofollowto internal links is rarely useful and can reduce how well a crawler follows your site structure.
Reading the attributes programmatically
The crawler-style extractor from the earlier chapter on discovery already records rel values. You can build on it to audit a page you publish. The script below lists every link whose rel list lacks one of the three values and whose host differs from the page's own host, so you can review whether each one should be labeled.
from html.parser import HTMLParser
from urllib.parse import urlparse
class LinkCollector(HTMLParser):
"""Collect href, rel values, and anchor text for every <a> tag."""
def __init__(self):
super().__init__()
self.links = []
self._current = None
def handle_starttag(self, tag, attrs):
if tag == "a":
attributes = dict(attrs)
if "href" in attributes:
self._current = {
"href": attributes["href"],
"rel": (attributes.get("rel") or "").lower().split(),
"text": "",
}
def handle_data(self, data):
if self._current is not None:
self._current["text"] += data
def handle_endtag(self, tag):
if tag == "a" and self._current is not None:
self._current["text"] = self._current["text"].strip()
self.links.append(self._current)
self._current = None
LABELS = {"nofollow", "sponsored", "ugc"}
def unlabeled_external_links(html, own_host):
parser = LinkCollector()
parser.feed(html)
results = []
for link in parser.links:
host = urlparse(link["href"]).netloc
if host and host != own_host and not (LABELS & set(link["rel"])):
results.append(link)
return results
page = """
<p>Our <a href="/pricing">pricing</a> page.</p>
<p>Read the <a href="https://example.org/study">study</a>.</p>
<p>Try <a href="https://shop.example.net/deal" rel="sponsored nofollow">this deal</a>.</p>
<p>A reader wrote: <a href="https://spam.example.com/">cheap stuff</a></p>
"""
for link in unlabeled_external_links(page, "www.example.com"):
print(link["href"], "|", link["text"])Running it prints two lines: the study link and the reader's link. The study link is probably a correct editorial link. The reader's link, if it sits in a comment, should carry ugc. The script cannot tell the two apart, because it does not know where on the page each link sits. A person still has to decide. A real audit would also account for subdomains and relative URLs, which this version treats simply.
Note the .lower() call on the rel string. HTML attribute values for rel are matched without regard to case, so rel="NoFollow" is valid and means the same thing.
Common mistakes
- Labeling everything nofollow. Some sites mark every outgoing link as
nofollowto be safe. This withholds endorsement from sources you do vouch for and makes your pages look less connected to the rest of the web. Reserve it for links you really do not vouch for. - Using nofollow for paid links.
nofollowis an acceptable label for paid links, butsponsoredis more precise. Using the exact value helps the engine understand the link. - Hiding paid links. Paid links with no label at all are the core problem that link-scheme policies address. You will meet this in the chapter on link spam.
- Putting the attribute in the wrong place. The
relattribute belongs on theaelement. Putting it on a wrappingdivorpdoes nothing. A page-wide robots meta tag withnofollowis a different mechanism, and it applies to every link on the page. - Expecting a ranking drop from other sites' labels. If another site labels its link to you as
nofollow, you did nothing wrong. It only means that link may pass less or no ranking credit. - Using it as a crawl-control tool. Adding
nofollowto a link does not prevent the target from being crawled or indexed if other links point to it.
What this means for your backlink profile
You cannot choose the rel values on links pointing to you, but you can read them. A healthy profile usually has a mix. Most links in a natural profile are plain editorial links, with some nofollow, ugc, and sponsored links among them. A profile made of nothing but unlabeled links from forums, comments, and directories looks unnatural, because natural profiles contain labeled links as well.
When you evaluate a backlink using the quality signals from the previous chapter, add the rel value as another input. A nofollow link from a respected publication can still bring readers and brand recognition. An unlabeled link from a page that exists only to sell links is a warning sign, however the attribute reads.
Third-party tools commonly report the rel value per link and let you filter on it. You will use that in the chapter on auditing.
Exercises
Exercise
A blogger reviews a laptop and links to it with an affiliate URL that pays a commission on each sale. Which rel value is the most accurate, and why?
Show answer
rel="sponsored". The link exists partly because of a financial arrangement, and sponsored is the value for paid links, advertisements, and affiliate links. Adding nofollow as well ("sponsored nofollow") is allowed but not required.
Exercise
Your site has a comment section. A visitor posts a comment that includes a link, and your editor approves it. Which value should the link carry, and does approving the comment change that?
Show answer
It should carry rel="ugc". The link was placed by a user, and moderation does not turn it into an editorial link. It would change only if your editors adopted the link into their own content.
Exercise
A site marks a link to your page with rel="nofollow". A teammate says the link is worthless and should be removed from your report. Give two reasons the teammate may be wrong.
Show answer
First, since 2019 Google treats nofollow as a hint, so the engine may still use the link to discover your page or give it some weight. Second, the link can still send real visitors and build awareness of your brand, which has value apart from ranking credit.
Exercise
The script in this chapter flagged a link to https://example.org/study that had no rel value. Does that mean the link is a mistake? What would you check?
Show answer
No. The script only lists external links without a label. An unlabeled link is correct for an editorial link you vouch for. Check where the link sits and why it is there: if it was paid for, label it sponsored. If a user placed it, label it ugc. If you do not vouch for the target, use nofollow. Otherwise leave it as is.