How To Make Automatic Table of Contents in Blogger Using Free Plugin And Shortcode
Topics We Cover (Search Keywords)
table of contents in blogger ,table of content blog,how to add table of contents in blogger,how to create table of contents in blogger,table of content in a blog,cara membuat table of content di blog,how to make table of contents in blogger,blogger table of contents
In this article, we are going to see how we can insert a working table of contents in blogger that too with a single shortcode. Blogger is a platform where there are lots of limitations compared to WordPress where a single plugin would do the job.
Now onwards you don’t have to depend upon long codes and javascript which would slow down your website. We present you the first shortcode based automatic table of content for blogger.
Features of our Plugin
We have designed this plugin especially for blogger such that no server load or third-party scripts are loaded besides the base jquery. And it only loads after your entire page is loaded so that other important content is loaded first and making sure our code doesn’t hurt them.

- Complete Shortcode based
- One time setup
- Optimized Code for Performance
- Toggle functionality
- Minimal CSS
And the best thing is, It’s completely free and licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Benefits of TOC
Table of Contents provide lots of benefits for a blog like it will help visitor to get an idea of your article. If your article is lengthy it would be a helpful thing for a reader to navigate between sections.
This can catch lazy readers to stay in your article and boost your CTR, this is not all the benefits there are lots of SEO benefits that we will discuss below.
SEO Benefits
There are lots of benefits in terms of SEO like Jump to links and one-line Sitelinks below articles. When you choose a template you would probably choose SEO optimized Blogger templates for your blog just like that TOC helps a lot in SEO.
Jump to Links in Google Search
Jump to links is very useful when you wrote a lengthy article and one of your sub-keywords is ranked on google. Jump to links would catch visitors quickly as it would match the searched keyword and take them directly to the portion of the particular article.

One-line Sitelinks
One-line sitelinks works like the ordinary sitelinks but the only difference is that it would be listing the contents in your TOC plugin. So whatever you wrote in your article would be highlighted below your post.

Table of Contents in Blogger
You have to configure little things before using the shortcode. This is a onetime job and after that, don’t have to worry about it.
First of all, make sure that jQuery and Font Awesome Icons are already installed in your blog, it is usually present in most of the themes and if you are not sure about this just open your theme and search for jquery in the search bar and same for the font awesome icons.
How to Add Table of Contents in Blogger
Please follow the instructions carefully, and always make sure that you have kept a backup of your theme in case of any errors. This step is for non AMP versions.
1. From your blogger dashboard click Edit HTML in Theme panel and paste the below code after the </body> tag.

<script async='async' defer='defer'>
var head,newLine,el,title,link,ToC="<nav class='table-of-contents' role='navigation'><h4 onclick='toc()'>Contents</h4><ul style='display:none'>";$("article h2, article h3, article h4, article h5").attr("id",function(arr){return "point" + arr;});$("article h2, article h3, article h4, article h5").each(function(){el=$(this),title=el.text(),link="#"+el.attr("id"),ToC+=newLine="<li><a href='"+link+"'>"+title+"</a></li>"}),ToC+="</ul></nav>",$(".toc-pro").prepend(ToC);function toc() {$(".table-of-contents ul").toggle();}
</script>2. After that paste the below CSS in between <style> or <b:skin><![CDATA[ and <style> or ]]></b:skin>

/* TOC by MFK (bloginos.com) */
.table-of-contents{flex:auto;width:fit-content;background:#eee;font-size:14px;padding:11px;margin:8px 0 30px 0}
.table-of-contents li{margin:0 0 0.25em 0}
.table-of-contents a{color:#2a5365}
.table-of-contents h4{margin:0;cursor:pointer}
.table-of-contents h4:before{font-family:FontAwesome;content:"\f0c9";padding-right:7px;}
/* For Fontaweosme 5
.table-of-contents h4:before{font-family:'Font Awesome 5 Free';content:"\f0c9";padding-right:7px;}
*/3. After Saving you’re theme, got to your blogger post editor and switch to HTML mode. Use this shortcode to insert the TOC in any of your posts.

<div class='toc-pro'></div>
That’s all, Now you don’t have to worry about any other code just use the above shortcode wherever you want the TOC to appear.
Post a Comment