Sub topic 11
Choosing Descriptive Anchor Text
This chapter assumes you can write an a element with an href, and that you know links must be real a elements to be crawlable (covered in the previous chapter). Here the focus is the clickable text inside the link: what it tells search engines, what it tells readers, and how to write it well.
What anchor text is and why it matters
Anchor text is the visible, clickable text between the opening and closing a tags. Search engines read it as a short description of the page the link points to. They combine the anchor text from many links, along with the content of the target page itself, to understand what that page is about.
For internal links you control both ends. You choose the anchor text and you choose the target page. That makes anchor text one of the cheapest and most reliable ways to tell a search engine what each page covers.
Anchor text also serves readers. People scan pages for links. Screen reader users often pull up a list of all links on a page and navigate by that list alone, out of context. A list reading "click here, click here, read more, here" is useless to them. A list reading "guide to writing URL slugs, 301 redirect checklist, canonical tag examples" works.
Weak, better, and broken
The markup below repeats the pattern from the crawlable-links chapter, now looking at the text.
<!-- Weak: generic anchor text -->
<a href="/guides/url-slugs/">click here</a>
<!-- Better: the anchor text describes the target page -->
<a href="/guides/url-slugs/">guide to writing URL slugs</a>
<!-- Not crawlable as a link: there is no a element with an href -->
<span onclick="location.href='/guides/url-slugs/'">guide to writing URL slugs</span>The third example shows that good anchor text does nothing if the link itself is not crawlable. Fix the markup first, then the wording.
Properties of good anchor text
Good anchor text has four properties.
- It describes the target. A reader who sees only the anchor should be able to predict what they will find after clicking.
- It is specific. "SEO" is a topic. "how to write URL slugs" is a page. Prefer the second.
- It is short. Two to six words usually works. A whole sentence as a link is hard to scan and dilutes the description.
- It reads naturally in the sentence. If you removed the link, the sentence should still read like something a person wrote.
Anchor text does not need to match the target page's title or main keyword. It should be an honest description. A page titled "URL Slugs: A Practical Guide" can reasonably be linked as "guide to URL slugs", "how slugs work", or "writing slugs".
Types of anchor text
SEO tools and audits group anchors into types. You will see these labels in link reports.
| Type | Example | Notes |
|---|---|---|
| Exact match | `301 redirects` pointing to a page targeting "301 redirects" | Fine in moderation. Repeated everywhere, it looks forced. |
| Partial match | `how to set up a 301 redirect` | The most useful default for internal links. |
| Branded | `Example Co. pricing` | Common for navigation and about pages. |
| Generic | `click here`, `read more`, `learn more` | Tells search engines and readers nothing. |
| Naked URL | `https://example.com/guides/url-slugs/` | Acceptable in references. Poor in running prose. |
| Image | `<img alt="...">` inside the link | The `alt` text acts as the anchor text. |
Aim for partial match as your default. Use exact match when it fits the sentence, and avoid generic anchors where you can.
Write the sentence around the link
The most common mistake is writing a sentence first and then wrapping "here" in a link. Reverse the order. Decide which page you are linking to, then phrase the sentence so the description is part of the link.
Weak:
- To learn how slugs work, click here.
- We covered redirects in another post. Read more.
Better:
- Learn how slugs work in our guide to writing URL slugs.
- Our checklist for 301 redirects covers what to update after a move.
Notice that the anchor does not include filler such as "our post about". Link the words that name the topic, and leave the framing words outside the link.
Context around the anchor
Search engines also look at the text near a link. A link inside a paragraph about redirects, pointing to a redirects guide, is a stronger signal than the same link in an unrelated footer. This is why in-content links usually carry more descriptive value than links in site-wide navigation, which repeat identically on every page.
Context lets you keep anchors short. If the surrounding paragraph already discusses canonical tags, the anchor "canonical tag examples" is clear without extra words.
Consistency across a site
Two situations need attention when many pages link to the same place.
Same target, varied anchors. If 40 pages link to your slug guide, they do not need 40 different phrasings, but they should not all use the identical string either. Write each anchor to fit its own sentence. Natural variation falls out of that. Forcing one exact keyword onto every link reads as manipulation, and the next chapter covers that pitfall.
Same anchor, different targets. Avoid using identical anchor text for different pages. If "redirects" links to your 301 guide on one page and to a redirect-chain audit on another, the label no longer identifies a page. Make the anchors distinct: "301 redirects" and "redirect chains".
Same target, same page. Linking to one URL twice on a page is fine. Use the same wording or similar wording for both, and do not link both places with different, competing descriptions.
Links without visible text
Some links have no text, such as a logo, an icon, or a product photo. The browser and search engine need a text equivalent.
<a href="/guides/url-slugs/">
<img src="/img/slug-diagram.png" alt="Diagram of a URL with the slug highlighted">
</a>Here the alt text becomes the anchor text. Write it as you would write an anchor: describe the destination or the function. An empty alt on a linked image leaves the link with no description at all. If the same page also has a text link to the same URL, the image link adds little, and that is fine.
Decision flow
When you add an internal link, work through this order.
Finding generic anchors with a script
A script can surface weak anchors across many pages. This one extends the link parser from earlier chapters and flags empty or generic anchor text.
from html.parser import HTMLParser
GENERIC = {"click here", "here", "read more", "more", "learn more", "link", "this page", "this"}
class LinkCollector(HTMLParser):
def __init__(self):
super().__init__()
self.links = []
self._href = None
self._text = []
def handle_starttag(self, tag, attrs):
if tag == "a":
self._href = dict(attrs).get("href")
self._text = []
def handle_data(self, data):
if self._href is not None:
self._text.append(data)
def handle_endtag(self, tag):
if tag == "a" and self._href is not None:
anchor = " ".join("".join(self._text).split())
self.links.append((self._href, anchor))
self._href = None
def is_weak(anchor):
return anchor == "" or anchor.lower().strip(" .") in GENERIC
html = (
'<p>Read the <a href="/guides/url-slugs/">guide to URL slugs</a> or '
'<a href="/more/">click here</a>. <a href="/pricing/">Read more</a></p>'
)
parser = LinkCollector()
parser.feed(html)
for href, anchor in parser.links:
if is_weak(anchor):
print(f"{href} -> {anchor!r}")Running it prints:
/more/ -> 'click here'
/pricing/ -> 'Read more'The script has known limits. It sees only text nodes, so a linked image with no text reports an empty anchor even when its alt text is good. It also checks only a fixed list of phrases, so you will extend GENERIC for your own site and language.
Edge cases
- Navigation and footer links. Short labels like "Pricing" or "Blog" are fine. They are branded or topical, and users expect them. Do not stuff them with keywords.
- Buttons styled as links. A call-to-action such as "Get started" is acceptable when the button's destination is obvious from context. If the same destination also appears in running text, use a descriptive anchor there.
- Titles and headings as anchors. Linking a whole heading is fine when the heading describes the target, as in a list of related articles.
- Changing a slug. After a 301 redirect, update internal anchors'
hrefvalues to the new URL. The anchor text may stay the same, but check that it still describes the page if the page's topic shifted. - Languages. Write anchors in the language of the page they sit on, and make them describe the target in that language. Do not link a French sentence with English anchor text unless the target is English.
Summary of the working rules
- Describe the target page in two to six words.
- Prefer partial-match phrasing that fits the sentence.
- Replace "click here" and "read more" with the topic name.
- Give different targets different anchors.
- Give linked images useful
alttext. - Fix link markup before polishing wording.
Exercise
A blog post says "We explain how to avoid redirect chains in this post." The word "this post" is linked to /guides/redirect-chains/. Rewrite the sentence so the anchor describes the target, and name the anchor type of your new version.
Show answer
One good rewrite is "Our guide to avoiding redirect chains explains the fix." with "guide to avoiding redirect chains" as the link. That is a partial-match anchor: it describes the target in natural words without repeating a bare keyword. "Redirect chains" alone would be a shorter, exact-match option and also acceptable.
Exercise
Two pages on your site use the anchor text "redirects". One links to /guides/301-redirects/ and the other links to /audits/redirect-chains/. What problem does this create, and how would you fix it?
Show answer
The same label now points to two different pages, so the anchor no longer identifies a single page for search engines or readers. Change each anchor so it is distinct and specific, for example "301 redirects" for the first and "redirect chains" for the second.
Exercise
The script in this chapter reports an anchor of '' (empty) for a link that wraps only an image. Is that link necessarily a problem? What would you check?
Show answer
Not necessarily. The script reads only text, so it cannot see the image's alt text. Check the img element's alt attribute. If it describes the destination, the link is fine. If alt is missing or empty, add a descriptive alt value or a text label.