You can use plugins to add a table of content to your WordPress website. If you love to play around with some tech, here is how to add a table of content without plugins.

Else, see lesson 3, where I highlighted five plugins for your table of contents.

I will use the block editor for all demonstrations in the demonstration below. If you are using the classic editor, I strongly advise moving to the block editor. It is more robust and easier to use.

Below are the significant steps we will take

  1. We will select the article you want to add a heading to

2. We will select the headings that we want in the table of content. I want to believe you have articles that have headings. If your articles do not have headings, kindly first create headings for each section of your articles. In my training titledhow to use headings for SEO, I explained how to use headings.

    Go to the first heading block and move your mouse around it. A toolbar will appear. Select the three dots indicating the more option. Then select the edit as HTML option as shown in the image below.


    We will open the tag and add unique identifiers to them. Below is a screenshot showing how I added a unique identifier to my header. I named it "create-1". I will do the same thing to other headers of my choice. Below are screenshots showing three other headers that I have attached—unique identifiers with the intention that they will form a part of my table of content.

    First


    Second

    Third

    After placing unique identifiers on the headers, Locate where you want your table of content. We are going to create a custom HTML block at that location. I always want my TOC to appear before my first H2 heading, so I will create my custom HTML block as shown below in my desired location.


    I will create jump links with the code below in my custom HTML block. Note that I have spelled it out as TOC with a div tag and denoted it as an ordered list.

    Here is what your code should look like.



    Join the Discussion
    Write something…
    Recent messages
    TheAR Premium Plus
    Thank you for this. I was thinking about reducing plugins by manually creating a Table of Content. I would love to know how to make this list "collapsible", please.
    Thanks.
    Reply
    Parameter Premium
    Thank you Collin

    I know plugins like LuckyWp make table of content easily collapsible.
    But honestly I never thought of achieving it with codes. I will find out, implement it and also get back to you on this. t
    Thanks a million for this intuitive look at it

    Ayodeji
    Reply
    TheAR Premium Plus
    Thanks.
    Much appreciated.
    Reply
    muslimah Premium
    Thank you for providing these TOC options.
    Reply
    Parameter Premium
    Thank you Badmus,

    I am glad you found it engaging. There are a lot of plugins for creating TOC in your wordpress website.

    Ayodeji
    Reply
    richardgb Premium
    Hi Parameter
    That's a good selection of options! There's been a lot of development with various TOCs over the last year or so.
    Personally I prefer Kadence blocks... :-)
    Richard
    Reply
    Parameter Premium
    Thank you Rich,

    I did not see this before, I would have added Kadence block as the sixth plugin. Hopefully I will include kadence block on the plugins later
    Reply
    Top