Seoxpert.io
lowCrawl & Links

Broken In-Page Anchor Targets

Pages link to #fragment targets that do not exist on the destination page, breaking table-of-contents and deep-link navigation.

By Seoxpert Editorial · Published · Updated

Why it matters

A fragment link like #pricing tells the browser to scroll to the element with id="pricing". If that element is missing, the page loads but the scroll never happens — the user lands at the top with no indication anything went wrong. This quietly erodes navigation confidence and is a common signal of stale content.

Impact

Direct: broken anchors defeat table-of-contents, sticky-nav jumps, and deep-links from external sites. Indirect: they signal that the content and the linking structure have drifted out of sync, which is a low-but-real quality signal.

How it's detected

For each crawled page the scanner records every id attribute on the page. It then walks every in-page fragment link (href="#something" or href="/other-page#something") and flags targets that do not resolve to any recorded id.

Common causes

  • Section heading was renamed without updating the anchor link that pointed to its old id
  • Table-of-contents component was not regenerated after a content restructure
  • Deep link from an external site references an anchor that was later removed
  • Spaces or special characters in id attributes that break hash matching

How to fix it

Fix both ends: update stale anchor links to point to the current id, or add a stable id attribute at the target location. For long-form articles, generate a stable id from the heading text and treat those ids as a contract — renaming an id breaks every inbound deep link from other sites.

Code examples

Broken anchor (link href does not match any id)

<!-- Link in table of contents -->
<a href="#pricing">Pricing</a>

<!-- Target section, renamed without updating link -->
<h2 id="pricing-and-packages">Pricing</h2>  <!-- href="#pricing" now fails -->

Correct: stable id that matches the link

<a href="#pricing">Pricing</a>

<h2 id="pricing">Pricing</h2>
<!-- id is stable even when heading text is edited; treat it like a URL -->

FAQ

Does this affect SEO?

Directly, very little. Broken anchors are primarily a user-experience issue. But they correlate with low-maintenance content, and Google's quality systems are designed to detect signals of neglect.

Should ids include spaces or special characters?

Stick to lowercase letters, digits, and hyphens. Spaces must be percent-encoded in URLs, and many browsers will not match ids containing slashes or other reserved characters.

Found this issue on your site?

Run a scan to see if Broken In-Page Anchor Targets affects your pages.

Scan my website →