Are you trying to learn how to create WordPress anchor links (aka jump links)?
Keeping your visitors engaged is crucial to your success as a content creator or website owner.
You must create a user-friendly experience allowing them to navigate your content EASILY.
One effective way to accomplish this is by using anchor links.
This post covers:
- What are anchor links?
- Benefits of using anchor links
- How to create anchor links (jump links) in WordPress
- Tips for optimizing anchor links for SEO
What Are Anchor Links?
An anchor link, also known as a jump link or a bookmark link, is a type of hyperlink that allows visitors to jump to a specific section of a page or post.
By clicking on an anchor link, visitors are taken DIRECTLY to the relevant section of the page rather than having to scroll through the entire page to find it.
Anchor links are handy for long-form content, such as blog posts, where visitors may not have the time or patience to read the entire article.
They can click on the relevant anchor link to get to the information they’re looking for instantly.
Example Of Anchor Links
Let’s look at an example to understand better how anchor links work.
Suppose you have a long-form blog post that covers several topics. You can create anchor links for each topic and place them in a table of contents at the top of the page (like in this post).
When visitors click on a topic link, they are taken directly to that section of the page.
This makes it EFFORTLESS for them to find the information they’re looking for without scrolling through the entire page.
Benefits Of Using Anchor Links
Using anchor links on your website offers several advantages.
- Anchor links improve the user experience by making it easier for visitors to navigate through your content. If you have very long articles, then anchor links are a must-have.
- Sharing direct links within an article on social media is faster and more efficient.
- They can also increase the time visitors spend on your website, as they can quickly find the information they’re looking for without having to spend time scrolling through the entire page (which may make them leave the page early).
- Anchor links can also improve your website’s SEO. When you use anchor links, you create internal links within your website, which can help search engines understand the structure of your content. This can lead to better indexing and higher rankings in search engine results pages.
Like every solution, there are always a few setbacks to consider.
- Anchor links can be distracting if overused. If your page has too many anchor links, it can overwhelm visitors, and they may not know where to start.
- They can be problematic for users who rely on screen readers or keyboard navigation. If the anchor links are incorrectly labeled, these users may have difficulty navigating the page.
- There is a possibility that they’re hard to implement if you’re not familiar with HTML or CSS. However, creating anchor links in WordPress is easy with the right tools and knowledge (Gutenberg makes it super easy!).
- If you’re changing domains or needing to add 301 redirects, it’s important to note that the identifier (#) is never sent to the server. This can complicate things and mess up your anchor links, making them useless.
How To Create Anchor Links (Jump Links) In WordPress
There are several ways to create anchor links in WordPress.
In this section, I’ll cover three methods: manually creating anchor links using the classic editor and Gutenberg, using a plugin to create a table of contents, and adding jump links to your menu.
1. How To Manually Create Anchor Links Using Classic Editor In WordPress
If you’re using the classic editor in WordPress, you can manually create anchor links by following these steps:
In Visual Mode
- Highlight the text you want to link to.
- Click on the “Insert/edit link” button in the toolbar.
- In the “URL” field, add a “#” symbol followed by the name you want to give the anchor link. For example, if you want to create an anchor link for the “FAQ” section, you could use “#faq” as the URL.
- Click “Add Link” to save the anchor link.
Repeat these steps for each section you want to link to. When you’re done, add the anchor links to the top of the page, like a table of contents (or even within text).
In Text Mode
This mode requires some technical knowledge as you need to know some HMTL to add it.
Go to text mode and find the text that you want to link.
The proper syntax is as follows:
<a href=”https://yourlink.com”>Link example</a>
Where the URL you are linking to is within the apostrophes and the label (text of the link) follows after the ending > parameter.
Always ensure the closing </a> tag comes after the label.
2. How To Add An Anchor To Another Page Or Post
To link to an anchor on another page or post in WordPress, follow these steps:
- Create the anchor link on the page or post you want to link to.
- Copy the URL of the page or post.
- Add a “#” symbol followed by the anchor link’s name to the URL’s end.
- For example, if you want to link to the “FAQ” section of a page with the URL “https://www.example.com/page/,” you would use “https://www.example.com/page/#faq” as the URL.
3. How To Add Jump Links To Menu In WordPress
To add jump links to your menu in WordPress, follow these steps:
- Create the anchor links on the page or post you want to link to.
- Go to Appearance > Menus in your WordPress dashboard.
- Select the menu you wish to add the jump links to.
- Click on “Custom Links” in the menu editor.
- In the “URL” field, add a “#” symbol followed by the name of the anchor link.
- For example, if you want to add a link to the “FAQ” section of a page with the URL “https://www.example.com/page/”, you would use “https://www.example.com/page/#faq” as the URL.
- Click “Add to Menu” to add the jump link to your menu.
4. How To Add A Table Of Contents With A Plugin
If you don’t want to create anchor links manually, you can use a plugin to add a table of contents to your page or post.
One popular plugin for this is “Table of Contents Plus.”
To add a table of contents to your page or post using this plugin, follow these steps:
- Install and activate the mentioned plugin. (If you’re new, I create a tutorial on how to install a WP plugin.)
- Go to Settings > TOC+ in your WordPress dashboard.
- Configure the settings for your table of contents, such as the heading levels to include and the position of the table of contents.
- Save your settings.
- Add the shortcode “[toc]” to your page or post where you want the table of contents to appear.
Another great plugin you can use is Easy Table of Contents, which is also available for free from the WordPress repository.
5. How to Create Anchor Links in WordPress with Gutenberg
If you’re using the new block editor in WordPress, here’s a step-by-step guide to creating anchor links:
- Create a new block and add a “Heading” block.
- Type the text you want to use as the anchor link, such as “FAQ.”
- Click on the “Advanced” tab in the block settings (on the right side).
- In the “HTML Anchor” field, add a name for the anchor link, such as “faq.”
- Repeat these steps for each section you want to link to.
- Add the anchor links to the top of the page, like a table of contents.
6. Advanced Anchor Linking Techniques
If you’re comfortable with HTML and CSS, you can use several advanced techniques to enhance your anchor links.
However, using these techniques sparingly and with caution is essential, as they can sometimes hurt your website’s performance. (I personally DON’T use them.)
Tips For Optimizing Anchor Links For SEO
To get the most out of your anchor links in terms of SEO, consider these tips:
- Use descriptive anchor text that accurately describes the content of the linked section.
- Avoid generic anchor text like “click here” or “read more.”
- Use relevant keywords in your anchor text, but don’t overstuff it with too many keywords.
- Place your anchor links within the body of your content rather than in the header or footer (a table of contents is the most common).
- Use anchor links strategically, and only link to relevant sections of your content.
- Test your anchor links to ensure they work properly, and fix any broken links (I always test every link multiple times, even after publishing an article).
- Use anchor links to improve the user experience, not to manipulate search engine rankings.
Anchor links are a simple but effective way to improve the UX on your website, increase engagement, and boost your SEO.
By following the steps and best practices outlined in this article, you can create practical and user-friendly anchor links that enhance the usability of your content.
If you’re not already using anchor links on your website, now is the time to start.
By implementing this technique, you can create a friendlier experience for your visitors, ultimately leading to more tremendous success for your website.
Note: This article was originally published on May 12, 2023. But our team regularly reviews it and updates it with necessary improvements for accuracy.