How to add “Table of Content” in Blogger/Blogspot?

able of content is a very important factor to rank a blog. If you want to show your site on google featured snippet, you should always try to add Table of content. But you do not get any option to add Table of Content in blogger. So in this article, I will share with you, how to add Table of content in blogger.

Benefits of Adding Table of Content:

If you have added table of content in your post, your post can show in google featured snippet. So, you will get huge organic traffic.

Go to and login with your Google account. Then go to the themes section of your blogger dashboard. Now click on edit HTML.

2nd Step:

After clicking on edit Html, you will see your site full theme HTML. 
Now search </head> tag and paste the below code code before </head>
Copy the below code:

<link href='' rel='stylesheet'/> <link href='' rel='stylesheet' type='text/css'/><script type='text/javascript'> //<![CDATA[ //*************Table of Content (TOC) plugin by function howtowebsTOC() {var howtowebsTOC=i=headlength=gethead=0; headlength = document.getElementById("post-toc").getElementsByTagName("h3").length;for (i = 0; i < headlength; i++) {gethead = document.getElementById("post-toc").getElementsByTagName("h3")[i].textContent;document.getElementById("post-toc").getElementsByTagName("h3")[i].setAttribute("id", "point"+i);howtowebsTOC = "<li><a href='#point"+i+"'>"+gethead+"</a></li>";document.getElementById("howtowebsTOC").innerHTML += howtowebsTOC;}}function howtowebsToggle() {var toviralideas = document.getElementById('howtowebsTOC');if (howtowebs .style.display === 'none') {howtowebs .style.display = 'block';} else {howtowebs .style.display = 'none';}} //]]> </script>

3rd step:

Now, Search for ]]></b:skin> Code and Paste Below CSS Code before ]]></b:skin>

.howtowebsTOC{border:5px solid #EE5535;box-shadow:1px 1px 0 #EDE396;background-color:#FFFFE0;color:#707037;line-height:1.4em;margin:30px auto;padding:20px 30px 20px 10px;font-family:oswald, arial;display: block;width: 70%;}.toviralideasTOC ol,.howtowebsTOC ul {margin:0;padding:0;}.howtowebsTOC ul {list-style:none;}.howtowebsTOC ol li,.howtowebsTOC ul li {padding:15px 0 0;margin:0 0 0 30px;font-size:15px;}.howtowebsTOC a{color:#EE5535;text-decoration:none;}.howtowebsTOC a:hover{text-decoration:underline; }.howtowebsTOC button{background:#FFFFE0;font-family:oswald, arial; font-size:20px;position:relative;outline:none;cursor:pointer; border:none;color:#707037;padding:0 0 0 15px;}.howtowebsTOC button:after{content: "\f0dc";font-family:FontAwesome; position:relative;left:10px; font-size:20px;}

4th Step:

Now, Search for <data:post.body/> and replace it with the code below

<div id="post-toc"><data:post.body/></div>

After that, save the html code and go to posts option.

5th Step:

Now edit your post on html format and paste the below code before first heading where you want to show your table of content.

<div class="howtowebsTOC"> <button onclick="howtowebsToggle()">Contents</button> <ol id="howtowebsTOC"></ol> </div>

6th Step:

At last, you have to add a code at the end of your post in html format



In think this post will help you to add Table of content in your blogger website. If you face any problem regarding this matter, you can tell me on comments.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top