In my post, I show you how to create a table of contents in WordPress without using a plugin.
When I started using WordPress, it felt like there was so much to learn, but once you use it for a while, it gets easier.
My guide takes you step by step, in just a few minutes, you will have a table of contents for your blog.
This is a table of contents from a post on my WordPress site. You can have this with a few clicks.

Let’s get started.
- First, create a list block
- Second, create a sub-heading
- Third, create an anchor link
- Fourth, add a table of contents
- Finally, add more to the table of contents
- How to add a table of contents video tutorial
- Frequently asked questions
- Conclusion
First, create a list block
To create a list block, select the plus icon on the top-left and search for ‘List’.

Select the ‘List’ block icon. Now you have a list block in your post. This is where your table of contents will be.

We want to link to sub-headings within the post content, we don’t have any yet, so the next step is to create a sub-heading.
Second, create a sub-heading
To create a sub-heading block, click on the plus icon on the top-left. Then search for ‘Heading’, like this.

Now you have a block to type your heading. The default heading is H2, this is for your top-level sub-headings.

To clarify headings, H1 is your blog title, H2 are the sub-headings in your post. H3 would be a sub-heading under H2, and H4 sub-headings sit under H3.
Type your first sub-heading into this block. For example, my sub-heading is ‘Create a list block in your WordPress editor’.

Now we have a sub-heading we can link to from our table of contents. To create a destination link, open the ‘Advanced’ drop-down menu on the right.

We are going to create an anchor link. An anchor link allows us to link to another place on the same page.
Advertisement
Third, create an anchor link
In the ‘HTML anchor’ box, type one or two words from your sub-heading. For example, I typed ‘listblock’.

Fourth, add a table of contents
Now, we have a heading in our post that we can link to. Next, return to the list block created earlier and type the first item on the list. This could be the same as the sub-heading or something similar.
My first heading was ‘Create a list block in your WordPress editor’, I typed that as the first item on my table of contents.

Next, click on the ‘Link’ icon in the toolbar. In the box that appears, type the symbol ‘#’ and then the text from the ‘HTML anchor’ box. Finally, select the ‘Apply’ icon. Like this.

Now, the list item is linked to the sub-heading. Therefore, when a visitor comes to the post, they can jump to the section they want to read using links in the table of contents.

Finally, add more to the table of contents
To add another item to your content list, press enter at the end of the first item and go through the same process. Create your sub-headings in your content, give them anchor links, finally, add the link destination to your table of contents.

How to add a table of contents video tutorial
Frequently asked questions
You can create a table of contents in WordPress by using anchor links. Anchor links allow you to jump to another place on the same page.
Use list blocks and anchor links to add a table of contents to your WordPress posts and pages.
Anchor links allow you to jump to another place on the same page.
Conclusion
Now you know how to add a table of contents in WordPress without a plugin or using any code.
Follow my step by step guide to add a table of contents to all your posts, it helps your visitors find the content they need quicker. It is about the user experience, the easier you make it for your visitor to interact with your blog, the more engaged they will be.
Before you go to add a table of content to your first post, may I ask a small favor? Please leave a comment letting me know if my blog post helped you. I really appreciate it.
If you enjoy learning WordPress through video, then please check out my YouTube channel. I post at least one video per week, sometimes more. I also have more WordPress tutorials on this website.
Thank You brother.
You are welcome.
I like to read well-written articles. It looks like you spent a lot of time and effort on your blog. I learned a lot from your article and I have already bookmarked and am waiting to read a new article. keep up the good work!
Thank you. I appreciate your comment.
This was helpful
Glad you you found it helpful.
Thank you Sir
You are welcome. Thank you for your kind comment.
Thank you for this!
You are very welcome. Thank you for your comment.
What if i dont use gutenberg?
I only use Gutenberg, if you use something else, try to find a tutorial for that.
Thank you for your article brother… nice website.
Thank you for your kind comment.
How do I make smooth scroll in the table of content ? waiting for your answer.
Hello,I don’t use this feature on my site but here is a link to a post that could help you. https://www.darrelwilson.com/how-to-add-smooth-scroll-to-wordpress/
OK Buddy. I have got it from another blog and clearly explain for the newbie. Just see it –
https://primomate.com/custom-table-of-contents-and-smooth-scroll/
Hi, I am glad you found a solution. Good luck with your site.