Content navigation

How to find and fix broken anchor links and missing fragments

Fix links that load the right page but fail to reach the intended heading, section or element.

Contents

What is an anchor link or URL fragment?#

An anchor link uses a fragment identifier after # to refer to a location or state within a resource. In a typical documentation URL such as /help/#installation, the page path identifies the document and the fragment identifies a target within it.

For a conventional HTML section link, the fragment normally corresponds to an element ID. If the document loads but the target no longer exists, the visitor may stay at the top or reach an unexpected location. The response code can still be successful because the document itself exists.

Why anchor links break after editing content#

Many content systems generate heading IDs from heading text. Renaming “Installation” to “Getting started” may change the generated fragment even if the topic remains on the same page. Reordering or duplicating headings can also alter automatically generated IDs.

Other problems come from copying an incomplete address, changing punctuation or placing the target inside content that is loaded only after interaction. A link that works on your open page may fail when someone enters the URL directly in a fresh tab. Treat these as different navigation conditions and test both.

Why anchor links break after editing content: reference checklist
SymptomLikely checkPossible repair
Page loads at the topDoes the fragment match an existing ID?Update the fragment or restore the old ID.
Wrong section receives focusAre IDs duplicated or unexpectedly generated?Give the intended target a unique stable ID.
Works only after interactionIs the target created after loading or expanding content?Expose a stable landing target or improve navigation behavior.
Old article links stopped workingDid the heading or document address change?Update the deep link and preserve useful compatibility anchors.

How to investigate a missing anchor#

Open the full destination URL including its fragment. Wait for the document to load, then check whether the intended section exists and whether the browser reaches it. Compare the fragment with the exact ID used by the page; do not assume that the visible heading text and generated ID are identical.

Use Linky to identify missing-anchor findings, then verify the relevant page state manually. The URL and fragment inspector on this website can separate the components of a pasted address, but it does not fetch the destination or prove that an element exists there.

  1. Copy the complete source link, including the fragment.
  2. Open it in a fresh tab and wait for the page to finish loading.
  3. Identify the intended heading or target element.
  4. Compare its ID with the fragment.
  5. Repair the source or target and test the published journey again.

Choose stable IDs for content people link to#

For frequently referenced documentation, choose stable IDs that describe the topic and can survive editorial wording changes. A visible title can improve without breaking every bookmark that points to it. Record important IDs when moving content between systems.

If an old anchor has many references, consider keeping a compatible target near the replacement section. Ensure it does not create duplicate IDs or interfere with accessibility. When compatibility is impractical, update the links you control and communicate the new destination where needed.

Example: renaming a setup section

A heading may change from “Installation” to “Install Linky” while retaining id="installation". Existing /help/#installation references can continue to work without requiring the visible title to stay unchanged.

Example: combining two documents

When two pages become one, map their important fragments to sections in the new document. Do not check only the page redirect; verify that deep references still reach the intended information.

Fragments, routing and special link formats#

Not every fragment is a simple element ID. Some applications use the fragment for client-side routing or application state. Text-fragment links can also identify text rather than a conventional target element. Identify the format before interpreting a checker result.

If your application depends on a special fragment route, test direct navigation and refresh behavior. If the link is meant to be an ordinary content reference, prefer a stable destination that visitors can open and share without needing a previous application state. Document exceptions in the audit rather than forcing every URL into one rule.

Check deep links during migrations and releases#

Add important fragments to the migration checklist alongside page paths. Documentation navigation, tables of contents and release notes often contain many section-level links. A URL migration can appear successful while leaving those references ineffective.

Before publishing, test links from another page, not only the local table of contents. After publication, run a page scan and review known deep references. Keep the intended topic, source page and new target together in the repair record so another editor can confirm why the destination changed.

  • Check generated heading IDs after edits.
  • Avoid duplicate IDs within the same document.
  • Preserve stable targets for frequently shared sections.
  • Test direct navigation into dynamically loaded content.
  • Review fragments when moving or merging documentation.

Frequently asked questions#

Can an anchor be broken even when the page returns 200?

Yes. The server can successfully return a page whose intended fragment target is missing. Check the document response and the section landing separately.

Should I use the heading text as the fragment?

Use the ID that the published page actually exposes. Content systems may normalize punctuation, add suffixes or use a custom ID that differs from the visible heading.

Can a server redirect fix every fragment problem?

Not automatically. Fragment behavior is handled by the browser and page context. Verify the complete destination journey, especially when the old and new documents use different IDs.

Put this workflow into practice

Read the related Linky documentation for the product controls and limits used in this article. Contact support if a result requires further investigation.

References and further reading

Use these primary references for search-engine behavior. The procedures and checklists above explain how to apply a link audit to practical website maintenance.

GET THE LINK CHECKER

Find the links that need a fix

Install the Linky browser extension to inspect the page you are viewing or audit reachable pages across a website. Review broken destinations, missing anchors and redirects, then locate the source that needs a fix.

Start for free. Compare plans for repeated audits, Site Structure and exports.

Related articles