Sub topic 5
Anchor text and what it tells a search engine
This chapter assumes you can read basic HTML and know what an <a> element, an href, and a rel attribute are. It also assumes you know what a backlink is and that crawlers record links as they crawl. If those are unfamiliar, review the earlier chapters on hyperlink anatomy and on how crawlers discover links first.
What anchor text is
Anchor text is the visible, clickable text of a link. In the HTML below, the anchor text is trail running shoes:
<a href="https://example.com/trail-shoes">trail running shoes</a>The href tells a crawler where the link goes. The anchor text tells it what the linking page's author says is there. A backlink therefore carries two pieces of information: a vote for the target page, and a short description of that page written by a third party.
The idea is old. In their 1998 paper describing the original Google prototype, Brin and Page noted that anchor text often describes a page more accurately than the page describes itself. They also noted that it makes it possible to index things a crawler cannot read as text, such as images and programs. Search engines still use this signal, though modern systems combine it with many others.
How a search engine uses anchor text
When a crawler fetches a page, it records each outgoing link along with its anchor text. The indexing system then associates that text with the target URL, not with the page that contains the link. A page can therefore be associated with words that never appear in its own content.
This gives search engines three kinds of information:
- Topic. If many unrelated sites describe a page with the words "trail running shoes", that is evidence the page is about trail running shoes, even if its own text is thin.
- Vocabulary. People often name things differently from the page's author. Anchors supply synonyms and informal phrasing that the page itself may not contain.
- Entity and brand signals. Links whose anchor is a business name help connect that name to its website.
Anchor text is a hint, not a command. The engine weighs it against the page's content, the quality of the linking page, and how the anchor is distributed across all links to the target.
Types of anchor text
SEO tools classify anchors into rough categories. The labels vary between vendors, but these are the common ones.
| Type | Example | What it signals |
|---|---|---|
| Branded | `Acme Shoes` | The site or business by name |
| Exact match | `running shoes` (when targeting that query) | The precise phrase a page wants to rank for |
| Partial match | `best running shoes for flat feet` | The topic, with extra words around it |
| Naked URL | `https://acme.example/guide` | Little about topic; the URL itself is the text |
| Generic | `click here`, `read more` | Almost nothing about the target |
| Image | no text; the image `alt` is used | Whatever the alt text says |
| Empty | link with no text and no alt | Nothing |
Each type has a role in a normal link profile. Most links that real people give to a site are branded, naked URLs, or loosely descriptive phrases. Writers rarely use the exact keyword a marketer would choose.
Classifying anchors with code
Counting anchor types across a set of backlinks is a common audit step. This script classifies each anchor and prints the distribution. It uses only the standard library.
from collections import Counter
from urllib.parse import urlparse
GENERIC = {"click here", "here", "read more", "this page", "link",
"website", "learn more", "more"}
def classify(text, href, brand, keyword):
"""Return a rough anchor-text category for one link."""
cleaned = " ".join(text.lower().split())
keyword = keyword.lower()
if not cleaned:
return "empty"
host = urlparse(href).netloc.lower()
if cleaned.startswith(("http://", "https://", "www.")) or cleaned == host:
return "naked_url"
if cleaned in GENERIC:
return "generic"
if brand.lower() in cleaned:
return "branded"
if cleaned == keyword:
return "exact_match"
if keyword in cleaned or set(keyword.split()) & set(cleaned.split()):
return "partial_match"
return "other"
links = [
("Acme Shoes", "https://acmeshoes.example/"),
("running shoes", "https://acmeshoes.example/running"),
("best running shoes for flat feet", "https://acmeshoes.example/running"),
("click here", "https://acmeshoes.example/running"),
("https://acmeshoes.example/guide", "https://acmeshoes.example/guide"),
("", "https://acmeshoes.example/"),
("running shoes", "https://acmeshoes.example/running"),
("a helpful buying guide", "https://acmeshoes.example/guide"),
]
counts = Counter(
classify(text, href, brand="Acme", keyword="running shoes")
for text, href in links
)
total = sum(counts.values())
for label, count in sorted(counts.items(), key=lambda item: (-item[1], item[0])):
print(f"{label:<14}{count:>3} {count / total:6.1%}")With the sample data, exact_match appears twice (25%) and each of the other six categories once (12.5%). The classifier is deliberately crude. It treats any anchor containing the brand as branded, and it counts a single shared word as a partial match. Real tools use larger rule sets, but the idea is the same: you cannot judge a profile without first bucketing the anchors.
Image links and other edge cases
Several situations change what counts as anchor text.
- Image links. If the only content of the link is an
<img>, search engines use the image'saltattribute as the anchor text. Without alt text, the link has no usable anchor. - Multiple links to the same target from one page. Do not assume every anchor is counted. Google has said it may use only some of them, so a navigation link with a generic label does not necessarily cancel a descriptive link in the body.
- Nested markup. Text inside
<span>or<strong>within the anchor still counts as anchor text. A crawler collects the text content of the whole element. - Fragment and JavaScript links. An
<a>without a crawlablehref, for example one that relies only on anonclickhandler, may not be treated as a link at all, so its anchor text is lost. - Title attributes. The
titleattribute is not anchor text. Do not put keywords there and expect them to be credited the way visible text is.
An image-link example:
<a href="https://acmeshoes.example/running">
<img src="/img/trail-shoe.jpg" alt="Acme trail running shoe, side view">
</a>Here the alt text acts as the anchor. Describe the destination or the image meaningfully, as you would for a screen reader.
Context beyond the anchor itself
Search engines do not evaluate the anchor in isolation. Two additional sources matter.
Surrounding text. Words near the link help interpret a short or generic anchor. A link labelled this guide inside a sentence about choosing hiking boots is not empty of meaning. Engines can read the sentence, so the weakness of generic anchors is that they waste an opportunity, not that they carry zero signal.
The linking page. The topic of the page that holds the link, and of the site as a whole, shapes how the anchor is read. jaguar on a car-review page and jaguar on a wildlife blog point at different things. The relevance of the linking page is covered in the later chapter on link quality signals, and this chapter only needs the principle that anchors are interpreted in context.
Why exact-match anchors became a risk
If anchor text helps a page rank for its words, then a site owner can try to get many links with the exact phrase they want to rank for. This happened at scale, and it has a famous early example.
- Google bombing. In the 2000s, groups coordinated links using a specific phrase to a specific page, so that page ranked for that phrase even though it did not contain the words. A well-known case made a political figure's official biography rank for the phrase "miserable failure". Google announced an algorithmic change in January 2007 to reduce this effect.
- Over-optimized profiles. A natural link profile has varied anchors. A profile where a large share of links use the identical commercial phrase looks engineered. Google's 2012 Penguin update targeted manipulative link patterns of this kind, and its link spam policies list keyword-rich anchor text as a feature of manipulative link building campaigns, for example in large-scale guest posting or article distribution.
The practical conclusion is that anchor text is useful as a signal, but trying to control it makes the signal suspicious. Anchor distribution in a healthy profile is a result of how many different people link for different reasons, and you cannot reproduce it by assigning phrases.
Writing good anchor text for links you control
You choose anchors for your own internal links, and for external links you place from your site. Apply the same discipline the search engine would reward.
- Describe the destination. A reader scanning only the links on a page should understand where each goes.
- Keep it concise. A few words is usually enough. Do not turn an entire sentence into a link.
- Vary naturally. Write for the sentence you are in. Do not copy one phrase across every internal link to a page.
- Avoid generic labels like
click here. They also fail accessibility checks, because screen reader users often navigate by a list of links. - Keep it consistent with the target. An anchor that promises something the page does not deliver misleads users and weakens the association.
Compare these two internal links to the same page:
<!-- Weak: tells no one anything -->
<p>To compare shoes for wide feet, <a href="/wide-fit-guide">click here</a>.</p>
<!-- Better: names the destination in natural words -->
<p>Our <a href="/wide-fit-guide">guide to running shoes for wide feet</a> compares fit across brands.</p>Internal anchors are the one place where you have full control, and they are not backlinks in the strict sense. Descriptive internal anchors still help search engines understand the target page, and they carry no manipulation risk when used in moderation.
Reading anchor text in an audit
When you review the links pointing at a site, anchor text is one of the first things to check. These patterns deserve a second look:
- A large share of anchors that are the same commercial keyword, especially from low-quality or unrelated sites.
- Anchors in a language or topic unrelated to the site, which can indicate hacked-site injection or spam.
- Many empty or image anchors with no alt text, which are missed opportunities rather than problems.
- A sudden spike of identical anchors within a short period.
A healthy profile typically shows a majority of branded, URL, and varied descriptive anchors, with exact-match anchors a small minority. There is no official threshold, so treat any percentage you read online as a rough heuristic and compare against competitors in the same niche instead. The later chapter on auditing backlinks shows where to find this data in Search Console and third-party tools.
Exercise
A page you manage is linked from 40 external sites. In an audit, 28 of those links use the anchor text "cheap running shoes", all on unrelated low-quality blogs. The other 12 are brand names and plain URLs on relevant sites. What does this pattern suggest, and what should you not do in response?
Show answer
The pattern suggests a manipulative or paid link campaign: a single commercial phrase repeated across unrelated, low-quality sites is the signature of engineered anchors. It could also be a negative-SEO or spam injection, so check when the links appeared and who placed them. You should not order more exact-match links or try to "balance" the profile by buying more brand-name links, because that is still link manipulation. Instead, find out whether you or a vendor created the links, ask for removal where possible, and use Google's disavow tool only if the links are clearly manipulative and you cannot get them removed.
Exercise
Rewrite this sentence so the link has useful anchor text, and explain why the original is weak: "We published the full test results, and you can read them <a href="/lab-tests">here</a>."
Show answer
One rewrite is: "We published the <a href="/lab-tests">full lab test results</a> for each shoe." The original anchor "here" says nothing about the destination, so a search engine gets little description from it, and a screen reader user hearing a list of links would not know what it leads to. The rewrite names the content, stays short, and reads naturally in the sentence.