Sub topic 2
Anchor text, nofollow, sponsored and ugc attributes
This chapter assumes you know what a backlink is, can read an HTML <a> tag, and have seen a backlink export as a CSV file. It covers the two parts of a link that decide what it is worth and how to read it: the anchor text and the rel attribute. You need both for the two tactics in this tutorial.
- Broken link building: the anchor text of the dead link tells you what the site owner expected to find. It also shapes what you can reasonably propose as a replacement.
- Unlinked mention reclamation: a mention that already carries a link with a particular
relvalue may or may not count as unlinked. Chapter 10 builds on the rules here.
Anatomy of a link
A link has a destination, a visible label and optional attributes.
<a href="https://example.com/event-tracking-guide" rel="nofollow ugc">event tracking guide</a>hrefis the destination URL.- The text between the tags is the anchor text. It is the clickable label.
reldescribes the relationship between the linking page and the target. Several values can be listed, separated by spaces.
Search engines read the anchor text and the surrounding words as a short description of the target page. They read rel as a statement about why the link exists.
Anchor text
Anchor text falls into a few common types.
| Type | Example | Typical use |
|---|---|---|
| Branded | Acme Analytics | The natural result of a mention reclaimed as a link |
| Naked URL | https://acme-analytics.com | Citations, forum posts, footnotes |
| Descriptive or partial match | guide to event tracking | The natural result of replacing a dead resource link |
| Exact match | web analytics software | Keyword-focused. Risky in volume |
| Generic | click here, this site | Common in casual writing, carries little meaning |
| Image | An image inside the link, where the `alt` text acts as the anchor | Logos, banners, screenshots |
Two practical rules follow from this table.
- Do not dictate anchor text in outreach. The site owner already has a sentence around the dead link or the brand name. Keeping the existing words is easier for them. It also produces the varied, natural profile that editorial links tend to have.
- Expect the type to follow the tactic. Reclaimed mentions come back mostly branded. Replaced dead links come back descriptive. A profile where most links use the same commercial phrase looks manufactured. Search engines treat that pattern as a warning sign, and chapter 15 returns to it.
When you replace a broken link, read the old anchor text. If it said "guide to event tracking", a page about pricing models is a bad replacement even when it is yours. The anchor text sets the expectation the new page has to meet.
The rel attribute
Without a rel value, a link is an ordinary link. Search engines may use it to discover the target page and as a positive signal about it. Three values change that.
| Value | Meaning | Use it for |
|---|---|---|
| `nofollow` | The linking site does not vouch for the target | Links the site cannot or will not endorse, when no more specific value applies |
| `sponsored` | The link was paid for or part of an advertising or sponsorship arrangement | Ads, paid placements, affiliate links, sponsored posts |
| `ugc` | The link sits in user-generated content | Comments, forum posts, profile fields |
Google announced these values in 2019. Since March 2020 it treats all three as hints, not strict commands, for ranking and for crawling and indexing. In practice, a link marked nofollow, sponsored or ugc usually passes little or no ranking credit. Do not count on that, and do not count on the opposite.
Values can be combined, for example rel="nofollow ugc". Parsers must therefore split on whitespace instead of comparing the whole string to "nofollow".
Page-level and header-level nofollow
A link can be nofollowed without any rel on the tag itself:
- A
<meta name="robots" content="nofollow">tag in the page head applies to every link on that page. - An
X-Robots-Tag: nofollowHTTP response header does the same.
A script that only inspects rel on anchors will miss these cases. When you qualify a prospect, check the page head as well.
Which value should a site owner use?
This diagram describes the site owner's choice. In both tactics you are asking for the last branch, an editorial link that the owner placed by choice and does not mark.
Why attributes matter in these two tactics
Broken link building. The dead link you found may itself have been a plain editorial link. That is a good sign. It shows the site owner links out to resources without restrictions. If the page is a comment thread or forum where the broken link was posted by a visitor, it will probably carry ugc, and a replacement would carry it too. Such pages are weak prospects.
Unlinked mentions. A page that links to your domain with nofollow is technically linked, but it earns less than a plain link. Whether to ask for a change is a judgment call.
- On a news site, a nofollowed link in an article may reflect a blanket policy. Asking rarely changes it.
- On a blog with an editorial link policy that differs from the default, a request may succeed.
Record the attribute in your tracking sheet either way, so you can see later which prospects were already linked and which links need no outreach.
Reporting. A nofollowed link still sends visitors and gives the brand a visible citation. It is not worthless. It is worth less for ranking purposes. Track it as its own category and do not mix it into your count of ranking-relevant links.
Reading link attributes with code
The script below classifies every link on a page that points to a given domain. It reads rel as a set, so combined values work, and it checks the page-level meta robots tag.
from urllib.parse import urlparse
from bs4 import BeautifulSoup
def classify_links(html, domain):
soup = BeautifulSoup(html, "html.parser")
domain = domain.lower()
meta = soup.find("meta", attrs={"name": lambda v: v and v.lower() == "robots"})
page_nofollow = bool(meta and "nofollow" in meta.get("content", "").lower())
results = []
for a in soup.find_all("a", href=True):
host = urlparse(a["href"]).netloc.lower()
if host != domain and not host.endswith("." + domain):
continue
rel = {value.lower() for value in (a.get("rel") or [])}
anchor = a.get_text(" ", strip=True)
if not anchor:
img = a.find("img")
anchor = "[image] " + img.get("alt", "") if img else ""
if "sponsored" in rel:
kind = "sponsored"
elif "ugc" in rel:
kind = "ugc"
elif "nofollow" in rel or page_nofollow:
kind = "nofollow"
else:
kind = "followed"
results.append((a["href"], anchor, kind))
return results
html = """
<html><head><meta name="robots" content="index,follow"></head><body>
<p>See <a href="https://acme-analytics.com/guide">Acme Analytics</a>
and <a href="https://www.acme-analytics.com/pricing" rel="nofollow ugc">pricing</a>
and <a href="https://acme-analytics.com/"><img src="logo.png" alt="Acme logo"></a>.</p>
</body></html>
"""
for href, anchor, kind in classify_links(html, "acme-analytics.com"):
print(kind, "|", anchor, "|", href)The output is:
followed | Acme Analytics | https://acme-analytics.com/guide
ugc | pricing | https://www.acme-analytics.com/pricing
followed | [image] Acme logo | https://acme-analytics.com/The ugc result for the second link shows the precedence in the code. A link marked nofollow ugc is reported under the more specific value.
Common errors
- Comparing
relas a string.rel == "nofollow"fails on"nofollow ugc". Split into a set. - Assuming case never varies. Values are case-insensitive in practice, so lowercase them before comparing.
- Ignoring page-level directives. A clean anchor on a page with
meta robots nofollowis still nofollowed. - Reading raw HTML only. Some sites add links or attributes with JavaScript after the page loads. If the source HTML and the browser's inspector disagree, trust the rendered DOM.
- Treating nofollow as proof of a bad prospect. Judge the page on relevance and placement first, then record the attribute.
- Asking for specific anchor text. It makes the request harder to grant and the result less natural.
Exercise
A page links to your domain with this tag: <a href="https://acme-analytics.com" rel="Nofollow UGC">Acme</a>. The page's head contains no meta robots tag. (a) What anchor text type is this? (b) Which rel values apply, and why does the script above still catch them? (c) Is this a good unlinked-mention prospect for outreach?
Show answer
(a) Branded anchor text, because the label is the brand name. (b) Both nofollow and ugc apply. The script lowercases each value and checks set membership, so the capital letters and the combined value do not matter. It reports the link as ugc. (c) Usually not. The ugc value means the link was probably posted by a visitor in a comment or forum. The site owner did not place it editorially, so a request to change it is unlikely to succeed. Record it as already linked, with a nofollow-type attribute, and move on to prospects with no link at all.
Exercise
You find a dead link on a resources page. Its anchor text is "free keyword research tools list". Your replacement candidate is a pricing page for your paid analytics product. Name two problems with this match, and say how the anchor text should guide your choice.
Show answer
First, the topic does not match. A reader who clicks "free keyword research tools list" expects a list of free tools, not a pricing page, so the site owner has no reason to swap it in. Second, a commercial page makes the request look like promotion and may be rejected or ignored. The anchor text records what the original page promised. Choose or create a replacement that delivers the same promise, such as a current list of free keyword research tools, and leave the existing anchor text unchanged.