Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Anchor link (#form) scrolls nowhere: how to find and fix it

CNV-097Medium impactCould addBy FunnelGuardPublished Updated
On this page

What this issue is

An anchor link (also called a jump link) points to a spot on the same page. The link ends in a hash, like https://example.com/offer#form. The browser looks for an element whose id is form and scrolls to it.

The problem happens when that element does not exist. The link is valid, so no error shows. The page simply stays where it is. Visitors think the button is broken.

Common causes: a typo (#contact-form vs #contactform), ids are case sensitive (#Form is not #form), a section was deleted or rebuilt, the page builder gave the section a new id, the form is added later by JavaScript or an embed, or the form sits on a different page.

Why it costs you leads or sales

Hero buttons like "Get a quote" or "Book a call" often jump down to the form. If the jump fails, the visitor has to scroll and hunt for the form themselves. Many will not. Mobile visitors are hit hardest, because the form can be several screens away.

It is also easy to miss. The page loads fine, the button looks right, and nothing is logged as an error. Paid traffic keeps arriving and the main button quietly does nothing.

Where the visitor is lost
  1. Ad clickVisitor lands on the page
  2. Tap CTAButton links to #form
  3. Jump to formNo element with id=form
  4. Fill in formVisitor never gets here
  5. LeadNo submission

The click works, but the jump has no target, so the form is never reached.

Form starts from the hero buttonExample numbers
Form starts from the hero button (example)Anchor broken: 20 %; Anchor fixed: 85 %033652085Anchor brokenAnchor fixed%

Example: share of hero button clicks that end up at the form, before and after the anchor is fixed. Numbers are illustrative.

How to check if your site has it

Test the anchor in a few minutes
  1. Click the button

    Open the page in a private window and click every button or menu link that points to a section. Do it on a phone too.

  2. Read the link

    Right-click the button, choose Inspect and note the href, for example #form.

  3. Search for the id

    In the Elements panel press Ctrl+F (Cmd+F on Mac) and search for id="form". No match means no target.

  4. Run a console check

    Paste the snippet below into the browser console. It lists every on-page anchor link with no matching id.

  5. Check late-loading forms

    If the form comes from an embed (HubSpot, Typeform, a calendar), reload and click quickly. The id may exist only after the embed loads.

List anchor links with no targetjavascript
[...document.querySelectorAll('a[href*="#"]')].filter(a => {
  const u = new URL(a.href, location.href);
  const same = u.origin + u.pathname === location.origin + location.pathname;
  const id = decodeURIComponent(u.hash.slice(1));
  return same && id && !document.getElementById(id) && !document.getElementsByName(id).length;
}).map(a => ({text: a.textContent.trim(), href: a.getAttribute('href')}));

How to fix it

There are two sides to every anchor: the link (href="#form") and the target (id="form"). Make them match exactly, including case. Use lowercase letters, numbers and hyphens, with no spaces.

Add or correct the anchor target
  1. Block editor

    Select the block that holds the form (a Group or Form block). In the right panel open Advanced and type form in HTML anchor (no # sign).

  2. Elementor or other builders

    Open the section, go to Advanced and set CSS ID to form. Menu labels differ by builder.

  3. Update the button

    Set the button link to #form and save.

Matching link and targethtml
<a href="#form" class="btn">Get a quote</a>

<section id="form">
  <h2>Request a quote</h2>
  <form>...</form>
</section>
Other fixes to apply when needed
  1. Form on another page

    Use the full path, such as /contact#form, so the browser loads that page first.

  2. Embed loads late

    Put the id on a static wrapper div around the embed, not on an element the script creates.

  3. Sticky header covers the form title

    Add scroll-margin-top to the target so it stops below the header.

  4. Smooth scroll

    Optional: add scroll-behavior: smooth to html so the jump looks natural.

Offset for a sticky header and smooth scrollcss
html { scroll-behavior: smooth; }
#form { scroll-margin-top: 90px; }
Broken vs fixed anchor

Before

  • Button links to #form
  • Section id is contact-form
  • Click does nothing
  • Visitor must scroll to find the form

After

  • Button links to #form
  • Section id is form
  • Page jumps to the form
  • Header offset keeps the title visible

How to confirm it's fixed

Confirmation checklist
  • Clicking the button scrolls to the form on desktop and mobile
  • The URL in the address bar ends with #form
  • Pasting the full URL with #form into a new tab loads the page and jumps to the form
  • The console snippet above returns an empty list
  • The form title is not hidden behind a sticky header
  • Tested after any caching or minify plugin has been cleared

How to prevent it happening again

Anchors break when someone edits a section without knowing a button depends on its id. A few habits help.

Prevention habits
  • Use short, stable ids such as form, pricing, faq and never rename them casually
  • Note which buttons rely on which ids in your page build notes
  • Re-test every in-page button after a redesign, theme update or page builder migration
  • When duplicating a section, change the copied id so it stays unique
  • Add the console snippet to your launch checklist
  • Prefer full-path links (/contact#form) when the target lives on another page

How FunnelGuard handles this

FunnelGuard does not check for missing anchor targets today. It is a possible future check, not a current feature.

What FunnelGuard does do is run your real customer journeys on a schedule, such as a lead form, and check each step. If a broken jump leads to a journey step that cannot be completed, for example the form never being found, that failure can show up in a journey run. But it will not tell you the anchor id is missing.

To watch for this issue yourself, run the console snippet above after each page change, click every in-page button on mobile, and add an anchor check to your release checklist. The Free plan (1 site, 2 journeys, daily checks, no card) covers your core form journey, and a free read-only website audit is available.

Questions people ask

Why is my anchor link not scrolling to the section?

Most often no element on the page has an id that matches the link. A link to #form needs an element with id="form". Check for typos, case differences, a renamed section or a form that loads after the page.

Why does my #form button do nothing?

The browser could not find an element with id="form", so it has nowhere to scroll. Inspect the page and search for that id. Add it to the form section or change the button to the correct id.

Are anchor ids case sensitive?

Yes. #Form and #form are different targets, so the id must match the link exactly. Use lowercase letters, numbers and hyphens to avoid mistakes.

How do I add an anchor link in WordPress?

Select the block, open Advanced in the sidebar and type a name into HTML anchor, such as form. Then set the button link to #form. Page builders like Elementor use a CSS ID field instead.

Why does my anchor link scroll but hide the heading behind the header?

A fixed or sticky header sits over the top of the page, covering the target. Add scroll-margin-top to the target element in CSS, with a value close to the header height.

How do I link to a form on a different page?

Use the page path plus the anchor, for example /contact#form. A bare #form only looks for the id on the current page.

Does FunnelGuard detect broken anchor links?

No, not yet. It is a possible future check. For now, test in-page buttons manually and use the console snippet in this guide after each change.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.