How to add an anchor link to a post

An anchor link is the hyperlink placed on a web page or post that links to a specified point further down that same page/post.

Example: Anchor link

It’s particularly useful for your site visitors to use when reading a long page of text and want to jump straight to a section they’re looking for. You could use it for a table of contents at the top of the page.

You could use a plugin to do this, but we prefer to keep plugins to a minimum so here’s how – using the text window.

You simply need to find your desired anchor point and give it an ID.

So, find the text you want to link to, in this case it will be “Here’s the new anchor link” you can see below. In our case we have already made it a Header 2.

We now click above right to view this window as text and find our text, it will appear like this (you can see the code that WordPress used to make it a header 2):

<h2>Here's the new anchor point</h2>

 

To turn it into an anchor, we now need to insert a line where the * is below:

<h2 *>Here's the new anchor point</h2>

 

Choosing “anchor-link” as our ID, this is the code to insert to show WordPress that this is the anchor link ID:

id="anchor-link"

 

The line will now look like this (using red for illustration only):

<h2 id="anchor-link">Here's the new anchor point</h2>

 

Now go back to the top of the page where you want to link from and link it to your newly created anchor point in the same way you would add an external link, but using a hashtag to show it’s a link to another point on that page:

The anchor point ID we created was “anchor-point” therefore our hyperlink will simply be “#anchor-point”.