How to Add Anchor Links in WordPress

While Google loves lengthy content (it really does; long articles rank higher in search results), most visitors totally despise it. Not everyone has the attention span for scrolling through lengthy posts. So you might need to do something about it to keep your visitors on your site.

And anchor links are one way to do that. Anchor links are used in the table of contents to allow visitors to jump to different subheadings in a longer article without refreshing the page. This way, your visitors can easily find the information they need without getting lost in an ocean of words. 

In today’s post, you will find a tutorial on how to add anchor links in WordPress. You can do that both with or without a plugin, this guide will cover both ways. But first, let’s have a thorough look at what exactly anchor links are and what they do.

Anchor links are like jump menu links or table of contents links. When you click on them, you will be taken to a specific spot on that same page, making it easier to get the exact information you need. They are usually found as a table of contents at the top of a page or post.

Anchor links are also used to create bookmark links and buttons which bring you back to the top of the page when you reach the bottom. They help visitors in navigating large landing pages. Plus, they boost your WordPress SEO. Sometimes Google shows anchor links in search results as a “jump to” link, allowing users to skip directly to a specific section of the results page. 

I’ll say you should start using this technique if you still don’t. In the following sections, I’ll show you how you can add those.


You can easily add anchor links in the Gutenberg block editor. First things first, go to the post editor. Then convert the text into a Heading tag. 

Now head over to the right-hand side panel and click on the Advanced tab. Then click the anchor text in the HTML Anchor box and copy it.

Now go to the text where you want to link it, select the text, and link it with a hash (#) right before the anchor name. 

That’s pretty much it.

So this was the basic way, but if you want to add anchor links automatically as a table of contents you need to use a plugin. I’ll be using Ultimate Blocks to add anchor links today. It has over 20 blocks including a Table of Contents block which can be used to add anchor links.


First of all, go get the plugin. For that, we need to go to the WordPress Dashboard. Then we will go to Plugins and then Add New. Now search for Ultimate Blocks, click on install now, and then activate it.

Now go to the post or page where you want to add the anchor links. Then click on the (+) sign, search for Table of Contents, and add that. 

A table of contents will be generated automatically with the heading tags. You can customize your table of contents as you want from the block settings and styles tab.


Conclusion

So this was the A-Z of adding anchor links. As you can see, anchor links aren’t simply useful; they’re also really cool. Now is the perfect time for you to start adding them to your WordPress pages and posts. Go ahead and get smart with your navigation. Your visitors will thank you.

Hope this helped and you managed to add anchor links in WordPress on your own. Thanks for dropping by.

Related Reads:

Introducing a New Table Block Plugin - Tableberg
This is default text for notification bar