A lot of the design choices you’ll make around your site reference usability and the User Experience (UX). What’s more, blog content – in general, reading your site’s pages – has lots of value. If you marry both of these, you’ll often consider ways to help the UX of your content. WordPress anchor links are a staple for your content’s UX.
Consider anchor links as inline navigation for the post in question. You can place them anywhere, but headings are a common use case. This lets a reader jump around a post if they wish without losing their way. It’s a top-notch UX consideration, and something most site owners should think about.
To show you how straightforward it is to use them, this post will look at WordPress anchor links. Before we get into the different ways you can add them, let’s talk about what they are, and what they can do for you.
What an Anchor Link Is
In a general sense, an anchor link is a clickable piece of inline navigation. It’s specific to a piece of content, and will take you to a later point on the page. We use them at WPKube to help you jump to the different steps in tutorials:
If you click on the link, the page will skip to the relevant section you specify. It’s a simple implementation that can have a great impact on the usability of your site. We’ll talk about some of these instances next.
Why You’d Want to Use Anchor Links In WordPress
We mention usability as a key motivator for using WordPress anchor links, and this is a solid primary reason for employing them. However, there are lots of use cases for adding them to your site. For example:
- If you like to offer super long-form content to your readers (such as 3,000-word posts), you’ll often have a table of contents. This is a tailor-made use for anchor links.
- Anchors can also work when you share bookmark posts. If you include an anchor within the URL, a reader will jump straight to the point you want them to see.
- Your Search Engine Optimization (SEO) can get a boost, because in some cases, search engines will display those WordPress anchor links as separate entries.
In a nutshell, if you want your readers to stick around on your site, and engage with your content, WordPress anchor links are a vital weapon in the battle for traffic. As for how to add them to your site, the next few sections will show you.
How to Add Anchor Links to Any HTML Code
The basis of adding WordPress anchor links is in HTML. In fact, you can use these on any website, not just within WordPress. There are two parts: the anchor and the tag.
First, you’ll add the anchor link as your would any other hyperlink – using <a>
tags. For the link itself, you’ll use an ‘octothorpe’ (otherwise called a hash or pound sign) before it:
<a href="#anchor-link">Click further down the page</a>
However, if you click this, the link will
[…]
This article was written by Tom Rankin and originally published on WPKube.