4 Basic Ways to Add WordPress Links to Page Section

More than half your audience will leave your website immediately if they can’t get the information they want within three seconds. However, by being able to set up a link to a specific page section in WordPress, you can solve this problem and reduce your bounce rate significantly.

An anchor link is the most common and effective tool to achieve this in WordPress. It allows you to add a link to a page section so that users can jump directly to the section of content they desire.

Understanding anchor links

Anchor/jump links are technically no different from normal links, as they redirect users to another location.

However, instead of leading to another website, they direct visitors to a specific section of content on a page. They refer either to a specific location on the page currently being visited or to a location on another page.

Anchor links are really helpful if your content is long and contains different headings and sections. With the help on an anchor link, you can ensure a user-friendly experience for your users.

How to add WordPress links to page sections

There are several ways to create anchor links for page sections, so let’s look through the different methods you can use.

HTML

One way to add jump links to WordPress articles is to include HTML code directly. Let’s take a look at how to do this.

Type the text you want to use as the link and create a hyperlink with a “#” prefix.

ppwp-add-wordpress-link-to-page-section

Use the <a href=" "> tag to create an anchor link with your text.

<a href="#understanding-anchor-links">Understanding Anchor Links</a>

Now identify the section of the page you want this anchor link to jump to. This can be a header, image, or paragraph.

Add an ID attribute to the target section. The ID value should match your hyperlink (without the #), using dashes instead of spaces. Important: each ID must be unique and appear only once per page.

<h2 id="understanding-anchor-links">Understanding Anchor Links</h2>

Once done, save your changes, publish the page, and test your jump link to ensure it works correctly.

Gutenberg Block Editor

With the help of the block editor, you can easily create a table of contents with anchor links. Before we start, you should define the position of your anchor link.

Click Settings in the top right of the screen to display the drop-down menu and select Block.

ppwp-block-context-settings-gutenberg

Next, scroll down to the Advanced section and fill the HTML anchor field with an ID.

ppwp-gutenberg-html-anchor-wordpress-link-to-page-section

When everything is ready, you need to create the jump links. Select the location of your link and click the Chain button to add the link.

ppwp-wordpress-link-to-page-section-gutenberg

In the field, enter the ID you created for the HTML anchor with the prefix “#”.

ppwp-gutenberg-wordpress-link-to-page-section

Once you’ve done this, you should find that your jump link is now ready for use.

Classic editor

If you are using the classic editor, adding HTML jump links is easy when you create in visual editor mode. Select the Visual section at the top right to create the jump link.

ppwp-wordpress-visual-editor-mode

In this section, select the text in which you would like to embed a link. Then tap the Chain button to add the link. A field will appear in which you must enter the jump link, starting with the # symbol.

ppwp-wordpress-link-to-page-section-classic-editor

Switch to the Text section, go to the place where your anchor link leads to and insert the ID.

ppwp-id-wordpress-link-to-page-section-classic-editor

Plugins

In addition to the methods mentioned above, you can use plugins to create WordPress links to page sections in a few simple steps. In this guide, we’ll look at the plugin Easy Table of Contents.

It can be time-consuming to create a table of contents for every article on your website. You have to manually insert different anchor IDs and links. Also, sometimes you want to change the table of contents to make it look better and friendlier for users.

With the Easy Table of Contents plugin, you won’t have to deal with these problems anymore. With this extension, you can automatically create tables of contents for all pages and articles on your website.

Immediately after installing and activating the plugin:

Go to Settings, select Table of Contents and look for the Enable Support section. Then click on the part you want to support.

ppwp-table-of-contents-wordpress-pages-posts

Go to Position and select the position of your table of contents in the drop-down menu.

ppwp-table-of-contents-position

In the Show if section, select the number of headings on your page or in your post.

ppwp-choose-when-table-of-contents

Once you have completed all of the above steps, remember to save your changes. Then go back to the Posts section and activate Insert table of contents.

ppwp-insert-table-of-contents

This extension will set all anchor IDs and create a full table of contents on your behalf. The table will expand to include all subheadings in your page or article unless you specify otherwise.

Conclusion

We’ve gone through how you can add a WordPress link to a page section and why you should do it. You can create anchor links using HTML, the block editor and the classic editor, but if using coding is not your forte, plugins can help you in this situation.