Sub topic 12
Anchor Text Mistakes and Link Attributes
Anchor text is the visible, clickable words of a link. You already know how to choose descriptive anchors. This chapter covers the ways anchors go wrong in practice and the rel attributes that change how a link is treated.
This chapter assumes you can read basic HTML, including the a element and its href attribute. It also assumes you know that search engines follow links to discover pages and read anchor text as a description of the target. Descriptive anchors and crawlable markup are covered in earlier chapters, and the audit that uses these checks comes in the next one.
Why anchor mistakes matter
A search engine reads the anchor text of every link pointing at a page. It uses that text as one signal for what the target page is about. Readers use the same text to decide whether to click.
Most anchor problems come from two sources. Some are lazy (generic or empty anchors). Others are overdone (repeating one keyword phrase everywhere). Both weaken the signal. Neither is a "penalty trigger" on its own, but both make your pages harder to understand.
The common mistakes
Generic anchors
Anchors such as "click here", "read more", "learn more", "this page", and "link" say nothing about the target. A search engine sees the same words pointing at many unrelated pages. A reader scanning the page, or a screen reader user listing all links on it, gets no information either.
<!-- Weak -->
<p>We wrote about slugs. <a href="/guides/url-slugs/">Read more</a></p>
<!-- Better -->
<p>We wrote a <a href="/guides/url-slugs/">guide to writing URL slugs</a>.</p>"Read more" buttons on blog index cards are the most common source. If the design needs a short button label, make the card title a link as well, so the descriptive anchor exists next to the generic one. You can also add an aria-label that names the target for assistive technology.
Empty anchors and image links
A link with no text and no image alt text has an empty anchor. This happens with icon links, and with image links whose alt attribute is missing or blank. For an image link, search engines use the image's alt text as the anchor text, so write an alt that describes the destination.
<!-- Empty anchor: no text and no alt -->
<a href="/shoes/running/"><img src="/img/shoe.png" alt=""></a>
<!-- Alt text acts as the anchor -->
<a href="/shoes/running/"><img src="/img/shoe.png" alt="Running shoes"></a>If an image sits next to a text link to the same URL, you do not need both to carry the anchor. Keep the descriptive anchor in the text link and leave the image alt short.
Naked URLs
A link whose visible text is the URL itself (https://example.com/p/8123) wastes the opportunity to describe the page. For a slug that is already descriptive it is acceptable in a footnote or source list. For body copy, use words.
Over-optimized, exact-match anchors
If every internal link to your running shoes page says "best running shoes", the pattern looks engineered. Real writing varies. Use the exact phrase sometimes, and use natural variations such as "our running shoe range", "shoes for road running", or a sentence fragment that fits the paragraph. The test is whether a human editor would have written it that way.
Related mistakes:
- Stuffing extra keywords into the anchor: "cheap best running shoes online buy".
- Using the same keyword anchor in every sidebar, footer, and body link so it appears hundreds of times.
- Linking a keyword in the first sentence of every article to the same page purely for ranking.
One anchor, several targets
If "SEO tips" links to /blog/seo-tips/ in one place and /blog/seo-tips-2019/ in another, you send mixed signals about which page owns that phrase. It also confuses readers. Pick one canonical target for each phrase. When two pages compete for the same phrase, that is a content problem to fix by merging or differentiating the pages. It is not a reason to rotate anchors.
Anchors that are too long
Linking an entire sentence or paragraph dilutes the signal and is hard to read. Aim for a short phrase of roughly two to six words that names the target. Do not fix this by trimming to a bare word. "Guide" alone is nearly as weak as "here".
Links that are not links
An onclick handler on a span or div has no href, so there is nothing for a crawler to follow and no anchor to read. Use an a element with a real href even when JavaScript enhances the behavior. This was covered under crawlable markup, and it remains the most damaging "anchor" mistake because the link does not exist for search engines at all.
Link attributes that change how a link is treated
The rel attribute on an a element describes the relationship between the pages. Google uses three values as hints about how to treat a link when crawling and ranking.
| Attribute | Meaning | Typical use |
|---|---|---|
| `rel="nofollow"` | Do not endorse or pass ranking credit through this link | Links you do not vouch for |
| `rel="sponsored"` | The link is paid or part of an advertisement or affiliate arrangement | Ads, sponsored posts, affiliate links |
| `rel="ugc"` | The link was added by users | Comments, forum posts, profiles |
| `rel="noopener"` | Stops the opened page controlling the opener window | Links with `target="_blank"` |
Three points that are easy to get wrong:
- Since March 2020, Google treats
nofollow,sponsored, andugcas hints, not strict commands. They usually take effect, but they are not guaranteed to. - You can combine values in one attribute, separated by spaces:
rel="sponsored nofollow". noopenerandnoreferrerare about browser security and referrer data. They have no SEO effect, and modern browsers applynoopenertotarget="_blank"links by default. Do not confuse them withnofollow.
<!-- Paid placement on another site -->
<a href="https://partner.example/offer" rel="sponsored">Partner offer</a>
<!-- A link a visitor posted in a comment -->
<a href="https://visitor.example/" rel="ugc nofollow">visitor's site</a>Do not use nofollow on your own pages
Internal links exist to pass discovery and context to your own pages. Adding rel="nofollow" to an internal link tells search engines not to treat the target as endorsed by you. It is almost never what you want. The old practice of "PageRank sculpting", which meant nofollowing internal links to funnel value elsewhere, does not work as intended. Ranking credit that would have flowed through a nofollowed link is not redistributed to your other links.
If a page should stay out of search results, handle that on the page itself with a noindex robots meta tag or by returning an appropriate status code. Do not rely on nofollowed links to hide it. Other sites and old links can still lead crawlers to the URL.
A few legitimate cases for internal nofollow exist, such as links in user-generated content areas on your own site (use ugc). Treat any internal nofollow you find as something to justify, not as a default.
The title attribute
The title attribute on a link shows a tooltip on hover. It is not a substitute for anchor text. It is poorly supported on touch devices and by many screen readers, and you should not rely on it to carry meaning that the visible text lacks.
Choosing the right treatment
Finding the problems with a script
You can detect most of the mistakes above mechanically. This script extends the link parser from the audit toolkit. It records the rel value and uses image alt text as the anchor for image links. It then flags generic anchors, empty anchors, internal nofollow, and one anchor pointing to several targets.
from collections import defaultdict
from html.parser import HTMLParser
GENERIC = {"click here", "here", "read more", "more", "learn more", "this page", "link", "this"}
class LinkCollector(HTMLParser):
def __init__(self):
super().__init__()
self.links = [] # (href, anchor, rel values)
self._href = None
self._rel = []
self._text = []
def handle_starttag(self, tag, attrs):
attrs = dict(attrs)
if tag == "a":
self._href = attrs.get("href")
self._rel = (attrs.get("rel") or "").lower().split()
self._text = []
elif tag == "img" and self._href is not None:
self._text.append(attrs.get("alt") or "")
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._rel))
self._href = None
def audit(links):
problems = []
targets_by_anchor = defaultdict(set)
for href, anchor, rel in links:
key = anchor.lower()
internal = href.startswith("/")
if not anchor:
problems.append(f"empty anchor -> {href}")
elif key in GENERIC:
problems.append(f"generic anchor '{anchor}' -> {href}")
if internal and "nofollow" in rel:
problems.append(f"internal nofollow, review -> {href}")
if anchor and internal:
targets_by_anchor[key].add(href)
for key, targets in targets_by_anchor.items():
if len(targets) > 1:
problems.append(f"anchor '{key}' used for {len(targets)} targets: {', '.join(sorted(targets))}")
return problems
html = """
<nav><a href="/guides/url-slugs/">URL slug guide</a></nav>
<p>Read <a href="/more/">click here</a> for details.</p>
<a href="/shoes/"><img src="s.png" alt=""></a>
<a href="/blog/seo-tips/">SEO tips</a> and <a href="/blog/seo-tips-2019/">SEO tips</a>
<a href="/login/" rel="nofollow">Log in</a>
<a href="https://partner.example/offer" rel="sponsored nofollow">Partner offer</a>
"""
parser = LinkCollector()
parser.feed(html)
for problem in audit(parser.links):
print(problem)Running it prints:
generic anchor 'click here' -> /more/
empty anchor -> /shoes/
internal nofollow, review -> /login/
anchor 'seo tips' used for 2 targets: /blog/seo-tips-2019/, /blog/seo-tips/The sponsored external link is not flagged, because sponsored is correct for a paid placement.
A script can only catch patterns it can name. It cannot judge whether an anchor reads naturally or whether a keyword is overused. Use it to produce a shortlist, then read the flagged links in context.
Edge cases
- Navigation and footer links. Sitewide links repeat the same anchor on every page. Keep them short and accurate ("Pricing", "Running shoes"). Do not turn the footer into a block of keyword-packed links.
- Breadcrumbs. Each crumb is an internal link whose anchor should match the page name. Breadcrumb anchors are naturally consistent, which is good.
- Redirected targets. An anchor pointing at an old URL that 301-redirects still works. It adds a hop, and it is better to update the link to the final URL.
- Fragment links. Links such as
/guide/#slugsdescribe a section. The anchor should describe that section, not the whole page. - Case and punctuation. Search engines treat "URL Slugs" and "url slugs" the same, so do not vary capitalization as a way to diversify anchors.
Summary of fixes
- Replace generic, empty, and naked-URL anchors with short phrases that name the target.
- Vary anchors naturally, but keep each phrase pointing at one target.
- Give image links meaningful
alttext. - Use
sponsoredfor paid links andugcfor user-submitted links. Do not usenofollowon your own internal links without a reason. - Treat
noopeneras a security setting, not an SEO one.
Exercise
A product page has three links to /shoes/running/. They read "click here", "best running shoes best running shoes cheap", and an image link with alt="". Rewrite the three anchors, and say which one does not currently give search engines any description at all.
Show answer
The image link with alt="" gives no description, because it has no text and no alt text, so its anchor is empty. Suitable rewrites are "see our running shoes" for the first, "road running shoes for every budget" (a short natural phrase instead of a repeated keyword string) for the second, and alt="Running shoes" for the image. The exact wording can vary, but each anchor should be short, readable, and describe the running shoes page.
Exercise
Your site has a comment section where visitors post links, and a "Partner offers" block with affiliate links to another company. Which rel value belongs on each group, and why should you not add rel="nofollow" to the "Log in" link in your main navigation?
Show answer
Comment links get rel="ugc" (optionally ugc nofollow) because users, not you, added them. Affiliate links get rel="sponsored" because they are paid or commercial. The "Log in" link is an internal link, and nofollow on internal links does not redirect credit elsewhere and weakens how your own pages are discovered. If the login page should stay out of search results, use noindex on that page instead.