Skip to content
HyperDAF editorialBlock Editor

How to Add Anchor Links in WordPress Block Editor

Long pages have a problem: readers cannot find the part they need. A guide with ten sections forces everyone to scroll from the top. An anchor link fixes that. It…

How to Add Anchor Links in WordPress Block Editor
Block EditorEditor-curated guide
8 min6 sectionsIntermediate
Table of contents6

Long pages have a problem: readers cannot find the part they need. A guide with ten sections forces everyone to scroll from the top. An anchor link fixes that. It is a link that jumps straight to one section of the page — no scrolling, no searching.

Anchor links are also how a table of contents works, how FAQ pages jump to answers, and how one page can link to an exact section of another page. They take two minutes to set up, and they need no plugin. This guide shows how to add them in the block editor, step by step.

What an anchor link is (and why long pages need it)

An anchor link is a link to a spot inside a page, not to a new page. A normal link looks like this:

https://hyperdaf.com/how-to-use-wordpress-block-editor/

An anchor link adds a # and a short name at the end:

https://hyperdaf.com/how-to-use-wordpress-block-editor/#headings

Clicking it opens the same page and jumps straight to the section called headings. The part after the # is the anchor — a name you give to a heading or a block.

Long pages need anchors because:

  • Readers arrive with one question. A FAQ visitor wants one answer, not the whole page. An anchor takes them there in one click.
  • Guides get a table of contents. A list of links at the top of a long guide — each one jumping to a section — turns a wall of text into something people can use.
  • Other pages can point at one section. Instead of linking to a whole guide and hoping the reader finds the right part, you link to the exact section that answers the question.
  • It costs nothing. No plugin, no code, no extra loading time. It is a built-in feature of the block editor.

You will use anchors most on guides, FAQ pages, documentation, and any page longer than a few screens.

Add an HTML anchor to a heading block

Everything starts with the anchor itself: a short name attached to a heading. Here is how to add one.

  1. Open the page in the block editor.
  2. Click the heading you want people to jump to. It can be any heading block — H2 or H3 both work.
  3. Look at the settings panel on the right. If it is closed, click the gear icon at the top right.
  4. Make sure the Block tab is selected at the top of the panel (not the Page tab).
  5. Scroll down to the Advanced section and open it.
  6. Find the field called HTML anchor. Type a short name in it — for example pricing or step-3.
  7. Click Update.

That is the whole job. The heading now has an anchor, and the link to it is your page address plus # plus the name: your-page/#pricing.

Anchor names have three rules:

  • Use lowercase letters, numbers, and hyphens only. step-3 is good. Step 3 is not — spaces break anchors.
  • Keep it short and clear. The name should say what the section is: pricing, faq, install. Avoid vague names like section-1.
  • Use each anchor once per page. Two headings with the same anchor name will confuse the browser. If two sections are similar, name them setup-windows and setup-mac, not setup twice.

You can add an anchor to almost any block, not just headings — paragraphs, images, and groups all have the same Advanced section. But headings are the best choice, because a heading is a natural landing spot: the reader arrives and the section title is right there.

If you are new to the editor, our guide on how to use the WordPress block editor explains the Block settings panel and where the Advanced section lives.

Link to the anchor from anywhere on the page

Once a heading has an anchor, you can link to it from any text on the same page. The usual place is a short list at the top — a simple table of contents.

  1. At the top of the page, type the list of section names — one line per section.
  2. Select the first line of text.
  3. Click the link button in the toolbar (or press Ctrl+K).
  4. In the link box, type # followed by the anchor name — for example #pricing. Do not type the full page address. Just the # and the name.
  5. Press Enter to apply the link.
  6. Repeat for each line.

Save the page and click a link in the list. The page should jump straight to that section.

A few tips for the list itself:

  • Keep the list short. Five to eight links is right for most pages. If the list is longer than the content, the page needs fewer sections, not more links.
  • Use the section’s own words. The link text should match the heading it jumps to. If the heading says “Pricing”, the link should say “Pricing” — not “Click here”.
  • Put the list where readers see it. Right after the introduction, before the first section. A table of contents at the bottom of the page helps nobody.

You can also link to an anchor from a button or an image, not just from text. A button at the top of a long sales page that says “See pricing” and jumps to the pricing section works the same way: link the button to #pricing.

Link to an anchor from another page

Anchors also work across pages. If one post answers a question in detail, another post can link straight to that section instead of to the top of the page.

The link is the full page address plus # plus the anchor name:

https://hyperdaf.com/how-to-use-wordpress-block-editor/#headings

To build one:

  1. Open the page you are linking from.
  2. Select the text you want to turn into a link.
  3. Click the link button and paste the full address with the #anchor at the end.
  4. Press Enter.

Test it: click the link and check that you land on the right section of the other page, not at its top.

This is also good linking practice in general. When you link to another page on your site, linking to the exact section that answers the reader’s question is better than linking to the top and making them search. Our internal linking strategy for WordPress explains how these small choices add up — the right link, to the right section, at the right moment.

Test the jump — and fix the 3 common mistakes

Always test every anchor link after you add it. Click it, watch where the page lands, and check that the heading is visible. These are the three mistakes that break the jump.

Mistake 1: the anchor name does not match. The link says #pricing but the heading anchor is priceing, or Pricing with a capital P. Anchor names are exact — one wrong letter and the browser does not jump at all. Fix it by opening the heading’s Advanced section and checking the name letter by letter.

Mistake 2: a space or special character in the anchor. An anchor called step 3 or FAQ's will not work. Spaces and quotes break the link. Rename the anchor with hyphens instead: step-3, faqs. Then update the link to match.

Mistake 3: the heading is hidden under a sticky header. On some sites the top menu stays fixed while you scroll. When the page jumps to an anchor, the heading lands right under that fixed menu and looks cut off. The jump worked — you just cannot see the heading. The fix is a little CSS on the heading (a top margin for scrolled-to headings), or a theme setting for anchor offset if your theme offers one. If the heading is only slightly covered, most readers will still find it — do not rebuild your header over this.

One more check: open the page in a private browser window and click the link again. If it works there, it works for everyone. If it only works while you are logged in, something else — usually a cache — is interfering.

FAQ: do anchor links help SEO?

Do anchor links help SEO?
They help readers, and that is what matters. A page that is easy to navigate keeps people on it longer, and Google notices when people stay. Google also sometimes shows jump links under a result for a long page, which can make your result more useful in search. But anchor links are not a ranking trick — adding them to a weak page will not make it rank. Add them because they help readers.

Can I add an anchor to a block that is not a heading?
Yes. Any block with an Advanced section can have an HTML anchor — paragraphs, images, buttons, groups. Headings are still the best choice, because the reader lands on a clear section title.

How many anchors should a page have?
As many as it has sections worth jumping to — usually one per H2 heading. A page with three sections needs three anchors. A page with fifteen sections probably needs fewer sections, not fifteen anchors.

Do anchor links work on phones?
Yes. The jump works the same on a phone as on a laptop. On a small screen they matter even more, because scrolling through a long page on a phone is slower.

What if I change a heading later?
The anchor stays the same unless you change it. If you rewrite a heading, the anchor name does not change with it — it keeps working. But if you rename the anchor itself, every link that points to the old name breaks. Change anchor names only when you must, and update the links at the same time.

Hayat Khan

Written by

Hayat Khan

Hayat Khan is the founder and owner of HyperDAF. He designs and develops HyperDAF's own WordPress themes, plugins and tools — every product on the platform is built, published and supported by his team, never resold from anyone else. He writes about WordPress, WooCommerce and building professional websites that are easy to run and maintain.

41 published articles
View all articles

Related articles

View all articles

Join the discussion

Your email address will not be published. Required fields are marked *

Keep comments relevant and respectful.