I want to display the table of contents only for specific blog posts

On this page, we'll introduce how to hide the table of contents for specific blog posts. This method can also be applied to product pages and collection pages.

There are 3 ways to hide the table of contents:

1. Using Meta Fields.

It's possible to hide the table of contents by setting the value of the following metafield for specific content.

[Meta Field Value to Hide Table of Contents]

How to Create Meta Field Definitions:


3. Click Add definitions 


2. Creating a "without table of contents" Blog Post Template.

This is a method to create a "Blog Post Template Without Table of Contents" in addition to the "Default Blog Post Template."

Add the "Table of Contents" app to the "Default Blog Post Template," but don't add it to the "Blog Post Template Without Table of Contents." By applying the "Blog Post Template Without Table of Contents" to specific blog posts where you don't want to display a table of contents, you can hide it for those particular posts.

Note: This method is only possible with Online Store 2.0 themes.

How to Create a Blog Post Template Without a Table of Contents:


7.  Disable or remove the table of contents app

8. Click save


How to Apply the "Blog Post Template Without Table of Contents" to Posts Where You Don't Want to Display a Table of Contents:


3. Do not use the headings set in "Headings to be used" in the blog post.

RuffRuff Table of Contents will not display a table of contents if none of the headings used in the table of contents exist in the blog post.

For example, if you have set up your blog post to use Heading 2 (h2) and Heading 3 (h3) for the table of contents, if you create your blog post avoiding Heading 2 (h2) and Heading 3 (h3), the table of contents will not be displayed.