{"id":2591,"date":"2025-11-27T09:27:23","date_gmt":"2025-11-27T09:27:23","guid":{"rendered":"https:\/\/tocwp.com\/docs\/?post_type=ht_kb&#038;p=2591"},"modified":"2025-11-27T11:13:36","modified_gmt":"2025-11-27T11:13:36","slug":"easy-table-of-contents-shortcode-documentation","status":"publish","type":"ht_kb","link":"https:\/\/tocwp.com\/docs\/knowledge-base\/easy-table-of-contents-shortcode-documentation\/","title":{"rendered":"Easy Table of Contents \u2013 Shortcode Documentation"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/tocwp.com\/docs\/knowledge-base\/easy-table-of-contents-shortcode-documentation\/#Why_Use_TOC_Shortcodes\" >Why Use TOC Shortcodes?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/tocwp.com\/docs\/knowledge-base\/easy-table-of-contents-shortcode-documentation\/#Shortcodes_and_Their_Detailed_Usage\" >Shortcodes and Their Detailed Usage<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/tocwp.com\/docs\/knowledge-base\/easy-table-of-contents-shortcode-documentation\/#header_label_%E2%80%93_Add_TOC_Title\" >header_label \u2013 Add TOC Title<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/tocwp.com\/docs\/knowledge-base\/easy-table-of-contents-shortcode-documentation\/#display_header_label_%E2%80%93_Hide_Title\" >display_header_label \u2013 Hide Title<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/tocwp.com\/docs\/knowledge-base\/easy-table-of-contents-shortcode-documentation\/#toggle_view_%E2%80%93_EnableDisable_Toggle\" >toggle_view \u2013 Enable\/Disable Toggle<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/tocwp.com\/docs\/knowledge-base\/easy-table-of-contents-shortcode-documentation\/#initial_view_%E2%80%93_Default_State_ShowHide\" >initial_view \u2013 Default State (Show\/Hide)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/tocwp.com\/docs\/knowledge-base\/easy-table-of-contents-shortcode-documentation\/#display_counter_%E2%80%93_ShowHide_Number_Counter\" >display_counter \u2013 Show\/Hide Number Counter<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/tocwp.com\/docs\/knowledge-base\/easy-table-of-contents-shortcode-documentation\/#post_types_%E2%80%93_Restrict_TOC_to_Specific_Post_Types\" >post_types \u2013 Restrict TOC to Specific Post Types<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/tocwp.com\/docs\/knowledge-base\/easy-table-of-contents-shortcode-documentation\/#post_in_%E2%80%93_Show_TOC_Only_for_Specific_IDs\" >post_in \u2013 Show TOC Only for Specific IDs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/tocwp.com\/docs\/knowledge-base\/easy-table-of-contents-shortcode-documentation\/#device_target_%E2%80%93_Device-Specific_TOC\" >device_target \u2013 Device-Specific TOC<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/tocwp.com\/docs\/knowledge-base\/easy-table-of-contents-shortcode-documentation\/#view_more_%E2%80%93_Limit_Headings_PRO\" >view_more \u2013 Limit Headings (PRO)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/tocwp.com\/docs\/knowledge-base\/easy-table-of-contents-shortcode-documentation\/#class_%E2%80%93_Add_Custom_CSS_Class\" >class \u2013 Add Custom CSS Class<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/tocwp.com\/docs\/knowledge-base\/easy-table-of-contents-shortcode-documentation\/#exclude_%E2%80%93_Exclude_Specific_Headings\" >exclude \u2013 Exclude Specific Headings<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/tocwp.com\/docs\/knowledge-base\/easy-table-of-contents-shortcode-documentation\/#heading_levels_%E2%80%93_Specify_Which_Heading_Levels_to_Include\" >heading_levels \u2013 Specify Which Heading Levels to Include<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>Easy Table of Contents<\/strong> shortcode feature allows users to embed a fully customizable Table of Contents (TOC) anywhere within their post, page, or custom content. This is especially useful for websites that require flexible placement of the TOC or need different TOC configurations on individual pages.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-rounded\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/ChatGPT-Image-Nov-27-2025-03_29_05-PM-1024x683.png\" alt=\"\" class=\"wp-image-2604\" srcset=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/ChatGPT-Image-Nov-27-2025-03_29_05-PM-1024x683.png 1024w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/ChatGPT-Image-Nov-27-2025-03_29_05-PM-300x200.png 300w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/ChatGPT-Image-Nov-27-2025-03_29_05-PM-768x512.png 768w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/ChatGPT-Image-Nov-27-2025-03_29_05-PM-50x33.png 50w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/ChatGPT-Image-Nov-27-2025-03_29_05-PM-60x40.png 60w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/ChatGPT-Image-Nov-27-2025-03_29_05-PM-100x67.png 100w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/ChatGPT-Image-Nov-27-2025-03_29_05-PM.png 1536w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Shortcodes offer complete control over TOC behavior, appearance, and functionality. Whether you want to display a title, show or hide the toggle, load on specific devices, or include\/exclude certain headings \u2014 these parameters make it simple.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Use_TOC_Shortcodes\"><\/span>Why Use TOC Shortcodes?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcodes are powerful because they:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Give <strong>full flexibility<\/strong> over TOC placement.<\/li>\n\n\n\n<li>Allow <strong>custom configurations per page or per section<\/strong>.<\/li>\n\n\n\n<li>Help control <strong>visibility based on devices<\/strong>.<\/li>\n\n\n\n<li>Provide advanced controls like exclusion, initial visibility, heading levels, etc.<\/li>\n\n\n\n<li>Let you add the TOC <strong>inside custom layouts, Elementor blocks, or themes<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Use Cases:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Websites using page builders where auto-insert may not work.<\/li>\n\n\n\n<li>Long-form articles needing TOC placed midway.<\/li>\n\n\n\n<li>Custom landing pages with selective headings.<\/li>\n\n\n\n<li>Mobile-optimized reading experiences.<\/li>\n\n\n\n<li>Documentation pages requiring grouped sections.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Shortcodes_and_Their_Detailed_Usage\"><\/span>Shortcodes and Their Detailed Usage<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Below are all the shortcodes provided, explained with purpose and examples.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\"><span class=\"ez-toc-section\" id=\"header_label_%E2%80%93_Add_TOC_Title\"><\/span><strong>header_label<\/strong> \u2013 Add TOC Title<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode:<\/strong> <code>[header_label=\"Title\"]<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Adds a custom title on top of the table of contents.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Use Case:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When you want a unique TOC heading like &#8220;Quick Navigation&#8221;, &#8220;On This Page&#8221;, &#8220;Summary&#8221;, etc.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<p class=\"has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background wp-block-paragraph\">[ ez-toc header_lables  =  &#8216;contents&#8217; ]<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"882\" height=\"339\" src=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/1.png\" alt=\"\" class=\"wp-image-2607\" srcset=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/1.png 882w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/1-300x115.png 300w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/1-768x295.png 768w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/1-50x19.png 50w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/1-60x23.png 60w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/1-100x38.png 100w\" sizes=\"auto, (max-width: 882px) 100vw, 882px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\"><span class=\"ez-toc-section\" id=\"display_header_label_%E2%80%93_Hide_Title\"><\/span><strong>display_header_label<\/strong> \u2013 Hide Title<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode:<\/strong> <code>[display_header_label=\"no\"]<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hides the TOC title completely.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Use Case:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When designing a minimal UI.<\/li>\n\n\n\n<li>When TOC is placed inside a styled card with its own heading.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<p class=\"has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background wp-block-paragraph\">[ ez-toc display_header_label = &#8220;no&#8221; ]<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"942\" height=\"302\" src=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/2.png\" alt=\"\" class=\"wp-image-2610\" srcset=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/2.png 942w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/2-300x96.png 300w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/2-768x246.png 768w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/2-50x16.png 50w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/2-60x19.png 60w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/2-100x32.png 100w\" sizes=\"auto, (max-width: 942px) 100vw, 942px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\"><span class=\"ez-toc-section\" id=\"toggle_view_%E2%80%93_EnableDisable_Toggle\"><\/span><strong>toggle_view<\/strong> \u2013 Enable\/Disable Toggle<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode:<\/strong> <code>[toggle_view=\"no\"]<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Removes the expand\/collapse toggle.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Use Case:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When you want TOC always fully expanded.<\/li>\n\n\n\n<li>Useful for SEO pages and documentation.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<p class=\"has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background wp-block-paragraph\">[ ez- toc toggle_view = &#8220;no&#8221; ]<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"818\" height=\"262\" src=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/3.png\" alt=\"\" class=\"wp-image-2611\" srcset=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/3.png 818w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/3-300x96.png 300w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/3-768x246.png 768w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/3-50x16.png 50w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/3-60x19.png 60w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/3-100x32.png 100w\" sizes=\"auto, (max-width: 818px) 100vw, 818px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\"><span class=\"ez-toc-section\" id=\"initial_view_%E2%80%93_Default_State_ShowHide\"><\/span><strong>initial_view<\/strong> \u2013 Default State (Show\/Hide)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcodes:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>[initial_view=\"hide\"]<\/code><\/li>\n\n\n\n<li><code>[initial_view=\"show\"]<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Controls whether the TOC is visible or collapsed by default.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Use Case:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Hide by default for mobile users.<\/li>\n\n\n\n<li>Show by default for long blogs.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<p class=\"has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background wp-block-paragraph\">[ ez-toc initial_view = &#8220;hide&#8221; ]<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/4.png\"><img loading=\"lazy\" decoding=\"async\" width=\"822\" height=\"171\" src=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/4.png\" alt=\"\" class=\"wp-image-2612\" srcset=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/4.png 822w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/4-300x62.png 300w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/4-768x160.png 768w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/4-50x10.png 50w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/4-60x12.png 60w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/4-100x21.png 100w\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\"><span class=\"ez-toc-section\" id=\"display_counter_%E2%80%93_ShowHide_Number_Counter\"><\/span><strong>display_counter<\/strong> \u2013 Show\/Hide Number Counter<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode:<\/strong> <code>[display_counter=\"no\"]<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hides numbering from the TOC items.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Use Case:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When headings should appear clean without numbering.<\/li>\n\n\n\n<li>Works well for design\u2011focused pages.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<p class=\"has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background wp-block-paragraph\">[ ez-toc display_counter = &#8220;no&#8221; ]<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/5.png\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"241\" src=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/5.png\" alt=\"\" class=\"wp-image-2613\" srcset=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/5.png 640w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/5-300x113.png 300w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/5-50x19.png 50w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/5-60x23.png 60w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/5-100x38.png 100w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\"><span class=\"ez-toc-section\" id=\"post_types_%E2%80%93_Restrict_TOC_to_Specific_Post_Types\"><\/span><strong>post_types<\/strong> \u2013 Restrict TOC to Specific Post Types<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode:<\/strong> <code>[post_types=\"post,page\"]<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Allows the TOC to scan specific post types.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Use Case:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Display only in pages.<\/li>\n\n\n\n<li>Display only in blog articles.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<p class=\"has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background wp-block-paragraph\">[ ez-toc post_types = &#8220;page&#8221; ]<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/6.png\"><img loading=\"lazy\" decoding=\"async\" width=\"630\" height=\"335\" src=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/6.png\" alt=\"\" class=\"wp-image-2615\" srcset=\"https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/6.png 630w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/6-300x160.png 300w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/6-50x27.png 50w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/6-60x32.png 60w, https:\/\/tocwp.com\/docs\/wp-content\/uploads\/2025\/11\/6-100x53.png 100w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\"><span class=\"ez-toc-section\" id=\"post_in_%E2%80%93_Show_TOC_Only_for_Specific_IDs\"><\/span><strong>post_in<\/strong> \u2013 Show TOC Only for Specific IDs<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode:<\/strong> <code>[post_in=\"1,2\"]<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Loads TOC only on selected post or page IDs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Use Case:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Using shortcode inside global templates.<\/li>\n\n\n\n<li>Testing TOC on specific pages.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<p class=\"has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background wp-block-paragraph\">[ ez-toc  post_in = &#8220;12, 15, 20&#8221; ]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\"><span class=\"ez-toc-section\" id=\"device_target_%E2%80%93_Device-Specific_TOC\"><\/span><strong>device_target<\/strong> \u2013 Device-Specific TOC<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode:<\/strong> <code>[device_target=\"desktop\"]<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Supports both:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>desktop<\/code><\/li>\n\n\n\n<li><code>mobile<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Use Case:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Show TOC only for desktop users.<\/li>\n\n\n\n<li>Reduce clutter on mobile.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<p class=\"has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background wp-block-paragraph\">[ ez-toc device_target = &#8220;mobile&#8221; ]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\"><span class=\"ez-toc-section\" id=\"view_more_%E2%80%93_Limit_Headings_PRO\"><\/span><strong>view_more<\/strong> \u2013 Limit Headings (PRO)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode:<\/strong> <code>[view_more=\"5\"]<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Loads only 5 headings initially, and shows the rest after clicking \u201cView More\u201d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Use Case:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Long documentation pages.<\/li>\n\n\n\n<li>Improve readability.<\/li>\n\n\n\n<li>Lighten the UI for mobile.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<p class=\"has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background wp-block-paragraph\"><strong>[view_more = &#8220;5&#8221; ]<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\"><span class=\"ez-toc-section\" id=\"class_%E2%80%93_Add_Custom_CSS_Class\"><\/span><strong>class<\/strong> \u2013 Add Custom CSS Class<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode:<\/strong> <code>[class=\"custom_toc\"]<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Allows styling your TOC using your own CSS.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Use Case:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Match theme design.<\/li>\n\n\n\n<li>Add custom borders, padding, fonts.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<p class=\"has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background wp-block-paragraph\">[ class = &#8220;blue-toc&#8221; ]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\"><span class=\"ez-toc-section\" id=\"exclude_%E2%80%93_Exclude_Specific_Headings\"><\/span><strong>exclude<\/strong> \u2013 Exclude Specific Headings<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode:<\/strong> <code>[exclude=\"Test\"]<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Excludes headings containing specific words.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Use Case:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Hide unwanted headings (ads, widgets, autogenerated text).<\/li>\n\n\n\n<li>Exclude headings like &#8220;Summary&#8221;, &#8220;FAQ&#8221;, etc.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<p class=\"has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background wp-block-paragraph\">[ ez-toc exclude = &#8220;FAQ&#8221; ]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading has-large-font-size\"><span class=\"ez-toc-section\" id=\"heading_levels_%E2%80%93_Specify_Which_Heading_Levels_to_Include\"><\/span><strong>heading_levels<\/strong> \u2013 Specify Which Heading Levels to Include<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode:<\/strong> <code>[heading_levels=\"2,3\"]<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Controls which headings (H1\u2013H6) are shown.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Use Case:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Show only H2 &amp; H3 for clean navigation.<\/li>\n\n\n\n<li>Exclude deeper headings like H4\u2013H6.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong><\/p>\n\n\n\n<p class=\"has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background wp-block-paragraph\">[ ez- toc heading_levels = &#8220;2, 3&#8221; ]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Using Easy Table of Contents shortcodes gives full control over how your TOC appears and behaves across different pages, devices, and layouts. Whether you&#8217;re creating professional documentation, long\u2011form content, or optimized mobile pages these shortcode options ensure flexibility, custom design, and improved user experience.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you need help customizing any specific use case or shortcode combination, feel free to to reach out to us!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Easy Table of Contents shortcode feature allows users to embed a fully customizable Table of Contents (TOC) anywhere within their post, page, or custom content. This is especially useful for websites that require flexible placement of the TOC or need different TOC configurations on individual pages. Shortcodes offer complete&#8230;<\/p>\n","protected":false},"author":2,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[5],"ht-kb-tag":[],"class_list":["post-2591","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-getting-started"],"_links":{"self":[{"href":"https:\/\/tocwp.com\/docs\/wp-json\/wp\/v2\/ht-kb\/2591","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tocwp.com\/docs\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/tocwp.com\/docs\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/tocwp.com\/docs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tocwp.com\/docs\/wp-json\/wp\/v2\/comments?post=2591"}],"version-history":[{"count":16,"href":"https:\/\/tocwp.com\/docs\/wp-json\/wp\/v2\/ht-kb\/2591\/revisions"}],"predecessor-version":[{"id":2623,"href":"https:\/\/tocwp.com\/docs\/wp-json\/wp\/v2\/ht-kb\/2591\/revisions\/2623"}],"wp:attachment":[{"href":"https:\/\/tocwp.com\/docs\/wp-json\/wp\/v2\/media?parent=2591"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/tocwp.com\/docs\/wp-json\/wp\/v2\/ht-kb-category?post=2591"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/tocwp.com\/docs\/wp-json\/wp\/v2\/ht-kb-tag?post=2591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}