Creating Links to a Specific Spot in a Post or Page (Commonly Used to Create a Table of Contents)

Last Update: October 08, 2018

I recently helped out a fellow WA member with creating a table of contents for a post she was writing. It occurred to me that creating this blog post might help others with the same issue.

There are many tutorials on how to create links to different areas within the same post or page or even to specific spots in other posts or pages. This one is another such tutorial but with little tweaks here and there that might make it easier for the technically challenged. I hope you find this useful.

Why create Links to Places in the Same Article or a specific place in a different article?

Don't I want people to read my whole article? Why would I create links to jump around it?

There are a few reasons where this can be beneficial to you:

  • Your post is so long, someone might skip it altogether. Offering a table of contents at the top that they can click on to get to the section that applies to them will offer them an out without actually leaving your post.
  • People skim articles all the time. I do it. Having links that lead back up your post to something important that might have been skipped over but is relevant to the current section (i.e. "Now take the dough you made in step 3 and roll it out about 1/4" thick" might be a good idea. You could make the "step 3" text link back to step 3 in case they didn't complete that task which is necessary in order to continue this one.).
  • Maybe a specific sub-topic of another article your wrote applies to your current one. Rather than take the reader to the whole article and hope they find what you want them to, you can simply take them directly to it. The catch here is you need to have access to the code of the article or know the anchor name that the author used for that particular section (if they used one at all).
  • Maybe you want to create a choose your own adventure post.

Really you're only limited by your imagination.

OK, I Know Why, Let's Get to How

Fair enough, onto the how-to:

  1. Create your post as your normally would (using Site Content, Google Apps, Microsoft Word, whatever) with a couple small changes:
    1. Type in your table of contents or link words, in the case of the "step 3" or choose your own adventure examples above. At this point they won't do anything but we'll fix that later.
    2. Type in a unique word in the location where you want your table of contents or link to go to when clicked. This word just needs to be different from other words you plan to use for the links (i.e. 1, 2, 3 are fine or you can use more descriptive words like start, why, how, etc.). For the member I helped it was Chapter 1, Chapter 2 and so on. These are just going to be used as anchors to link to.
  2. Publish the post.
  3. Log into your site dashboard and go to Posts or Pages and click on your newly posted article to edit it.
  4. Click on the Text tab to go to the code version of your post.
  5. Find your unique words and surround them with <a name=""></a> where your unique name falls between the quotes. An example would be <a name="3"></a>. Doing this will turn that unique name into a hidden link and it will no longer be visible on the post itself.
  6. Once you've done this for all of your unique words click on the Visual tab to return to the visual editing mode. You'll now see a little anchor icon where the unique words once were. If you don't, you may have to click update to save the changes.
  7. Now navigate to your table of contents or link words and highlight the one you want to use to link to your first hidden anchor.
  8. Click on the Insert/Edit Link icon at the top of the editor and type #uniquename where uniquename is the unique name you used in step 1b. My example would be 3 so it would look like this: #3
  9. Repeat steps 7 and 8 until you've finished creating all of the links.
  10. Once you've setup all your links click the Update button to publish your changes.
  11. Test it out.

If you want to link to a specific spot in another post or page, go to that page, create the hidden link, following steps 1b, 3, 4, 5 and click on Update, or get the hidden link from the owner of that page if it isn't you, assuming there is one, then, in your post you with to link from perform steps 7 and 8 but, when entering the unique name, put the full URL to the post before your unique name. An example would be:

The example above would take you to the GNARBOX section of my post on portable photo backup devices.

I hope this helps someone looking to create links to specific areas of their posts or to a specific area in a different post.

If have any questions, suggestions or comments, please leave them below.

Thank you

Join the Discussion
Write something…
Recent messages
MegaWealthy9 Premium
Thanks Scott! This is great! I am even more technically challenged than the average technically challenged... It would be great to have all this illustrated in a short video... :-) If you are up to the challenge, I would be the first person to watch it! :-)
merlynmac Premium
I actually plan to do that when I convert this blog into a training. I'm just not sure when that will be quite yet.
MegaWealthy9 Premium
Take your time. Marion Black has a video about it so I watched it and now I'm all good. :-)
merlynmac Premium
MegaWealthy9 Premium
Akhir, the way to do this has changed now that WordPress has a new version. I am going to publish a WA blog post about this tomorrow. :-)

Marion Black has excellent trainings about all sorts of topics. You can type her name in the search area at WA (top of page) and you shall see all her amazing work. :-)

juanster2017 Premium
Thanks for sharing this post
merlynmac Premium
Glad to help.
JamesJB Premium
Thanks for this tutorial. I'll have to sit down and try it out one day soon
merlynmac Premium
Glad you liked it. Let me know if you hit any snags or have a suggestion on how to make it better.
JamesJB Premium
Thank you, Scott. I will most certainly knock on your door when I get stuck :)

mbouteiller Premium Plus
Hey Scott,

Thanks for sharing this great tutorial. I use this method in my long posts and it works great!

merlynmac Premium
Thank you!
SAWalden Premium Plus
Thank you for sharing this!

I have a couple - probably more like 3 or 4 articles where my readers would likely appreciate such links.

Can't wait to give this a try - and now I have to follow you!
merlynmac Premium
Glad I could offer something someone finds useful :).