An important part to keep in mind when blogging, especially for long posts, is navigation. Adding anchor links to your posts can greatly improve the user experience. They can easily jump directly to any section of the blog to either browse the content or focus on what they really need.
An anchor link is simply a type of link on a page that links to other content on the same web page. This is very important for long articles with many different subheadings and sections. Add a small table of contents at the top of your post with anchor links to various subsections and your post will look very professional.
Anchor links are also great for SEO as they will show up in Google search results! Add some nifty anchor links to your subheadings and Google will provide direct links to your anchor tags right from Google search results.
So now that you know the benefits of using anchor links in WordPress, let’s see how you can include them in WordPress posts and pages.
In order to add anchor links to WordPress posts, you need to use hyperlinks using the WordPress editor. Just take the text that will be the menu item and wrap it in a link using the insert link button.
Here you can add your anchor link using ‘#’ as a prefix followed by the slug text or anchor link id you want to use. For example, let’s call the anchor link
Then you grab the text you want to link to. Most often this is a subheading of some kind.
Click on the advanced options button on the toolbar and select the edit as HTML option.
Then take the HTML tag in the code and add an id attribute to it with the slug text of our anchor id. Remember that you need to add this identifier to the HTML tag without the “#” prefix.
< h3 id = “anchor_link” > Anchor Text < / h3 >
Then click on the “Edit Visually” button .
If you follow these steps correctly, you should have a functioning anchor link tuned to your headline or other text element.
In this way, you can create a convenient navigation in the form of text content with anchor links that will help your readers.
As you can see, adding anchor links to WordPress posts is very easy.
A small demo for clarity