How to Create an Anchor Link in WordPress
It is always a good idea to provide your visitors with a dynamic experience while they browse your website’s content. Moreover, including some interactivity can surely benefit your site and engage the audience. Including anchor links in your textual content can definitively give you that additional flare. That’s why we’ll show you how to create an anchor link in WordPress in this article.
Anchor links are essentially a one-page navigation method. Namely, you can set certain pieces of text (e.g. headings or titles) to lead to other bits of text (like a paragraph) when clicked. This provides readers with a satisfying, effective and easy-to-use navigation method, all within the same page.
Creating an Anchor Link
So let’s get to the point; how do you create an anchor link? We’ll present this process in a few simple and easy-to-follow steps.
For the sake of making an example, let’s say that you’d like the page to scroll to the third paragraph of your text when the heading is clicked on.
First off, to achieve this, you should switch from the Visual to Text editing mode. You’ll notice these two tabs in the top right corner of the editor.
Locate the starting point of the text bit you wish the anchor link to lead to (in this case the third paragraph). Next, paste this <a id=”anchor”></a> in front of the paragraph. Note that we are using the word anchor only as an example here, and you can put any word you like between the quotation marks.
The next step is to mark the actual anchor link. To achieve this, you should return to Visual editing mode by clicking the top right tab. Now let’s link the paragraph to the heading. Select the heading, and click the Link icon from the menu above. Insert this link #anchor.
Please note that the word you insert here should correspond to the word you entered for the part you wish to link to. We put anchor in both places, however you can pick any other word as long as the word from the link matches the word used in the linked part.
All that’s left at this stage is to click update at the top right of the page and preview the changes you made. Once you are on the live website, you’ll now be able to get the page to automatically scroll down to the third paragraph once you click the heading. In addition to this, you can create anchor links for any of the sections you pick and see fit.
This rounds up the entire process. We hope we have been successful in conveying how simple it is to create an anchor link in WordPress. Moreover, this article should provide you with all the knowledge needed to create as many anchor links as you’d like; just remember to use a different link word for each new anchor on the page, and you’re all set!