Probably everyone else remembers how to do this, but I didn’t, and if it helps even one person I’ll be glad.
Suppose you’re writing a blog post, and suppose you want to link to a nice useful chart on a page in someone else’s site.
- Step 1, create the link in your WordPress page or post. If you’re still using Class Editor, just click the Insert/edit link button and add the url you’d like to go to.
- To find the anchor text, just right click on the area you’d like to link directly to, click Inspect to inspect the element (if you’re not using Chrome, a) why? and b) you may have to do this slightly differently but I’m confident you’ll figure it out or come back to the One True Church of Google) and find the name of the section you’d like to specifically link to.
- Step, 2, toggle over to Text view and add #WhateverTheIDis to the end of your url in the a href. (come to think of it, you can also just do this in the visual version while adding the link if you know the anchor text…but if you’re like me and have the working memory of a goldfish, just put in the link from the pages address bar, and then find the link again in the text view).
Unfortunately, if there is no id or section name – as is the case in many WYSIWYG sites like this one, you’ll have to try a different method. You can look for any nearby headers and sometimes cheat the system (eg, if there’s a single H3 there, it will take you where you need to go) but this is really not a perfect solution. Gutenberg will allow us to start easily adding anchor links to our sites if you want to have them on your site. Per Kinsta, they are helpful for users and give a little SEO boost, so why not? Only possibly downside I can think of is your extra time in creating anchor ID’s and the slight extra time for loading the slightly greater amount of code.
If you’re not completely sure about what an anchor text is, here is a nice intro from Mozilla. They’ve always got our backs.
Leave a Reply