Table of contents

#143304
Viewing 9 replies - 1 through 9 (of 9 total)
  • Danial
    Rank Math business

    Hello,

    Thank you for contacting Rank Math, and sorry for any inconvenience that might have been caused due to that.

    Rank Math does not generate a Table of Content.

    We do have a list of recommended plugins that we recommend:
    https://rankmath.com/compatibility/?s=table+of+content&post_type=rm_compatible

    Rank Math will check the presence of a popular TOC plugin and pass the test if it finds any listed plugins.
    https://rankmath.com/kb/score-100-in-tests/#table-of-contents

    If you are using any other plugin for adding a Table of Content, please contact your plugin/provider and ask them to add this filter to their plugin/theme so Rank Math can detect that you are using a Table of Contents section in your posts:
    https://rankmath.com/kb/filters-hooks-api-developer/#add-toc-plugin

    I hope this helps you with your issues.

    Yes, like I said in the post: I don’t want to use any extra plugins.

    How does Google recognise if I have table of contents or not?

    Hello,

    Thank you for following up.

    You can check this tutorial to make a valid table of contents that Google detects with HTML and CSS:
    https://www.tipsandtricks-hq.com/simple-table-of-contents-toc-using-pure-html-and-css-code-9217

    Please note that there is currently no way of detecting the table of content inside the post’s content with our content analysis if your TOC is built with HTML. Detecting a preset plugin list is the only way we are able to do it currently. If you are manually adding a hard-coded Table of Contents section, you can modify this filter to disable that particular test:
    https://rankmath.com/kb/filters-hooks-api-developer/#remove-content-analysis

    I hope that helps. Thank you, and please don’t hesitate to contact us if you need further assistance.

    Hello,

    I am using this code to remove the TOC warning, place it in functions.php, but the plugin still give the TOC warning, any idea what I am missing?

    
    /**
     * Rank Math snippet to disable 'contentHasTOC' test.
     *
     * @param array  $tests Array of tests with score
     * @param string $type  Object type. Can be post, user or term.
     */
    add_filter( 'rank_math/researches/tests', function( $tests, $type ) {
    	
    	unset($tests['content-readability']['contentHasTOC']);
    
    	$tests['basic']['keywordInMetaDescription']['score'] = 4;
    
        return $tests;
    }, 10, 2 );

    Thanks!

    Hello,

    Thank you for the follow up.

    Please use it as follows:

    /**
     * Allow developers to modify the test or score.
     *
     * @param array  $tests Array of tests with score
     * @param string $type  Object type. Can be post, user or term.
     */
    add_filter( 'rank_math/researches/tests', function( $tests, $type ) {
     unset( $tests['contentHasTOC'] );
     return $tests;
    }, 10, 2 );
    

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Thanks, this version works great!
    After I added it, I see 2 more points added to the score.
    This new method adds the points automatically, that’s why we don’t need this line?

    	$tests['basic']['keywordInMetaDescription']['score'] = 4;
    

    Hello,

    Rank math has a certain score for every test.

    Unsetting the test for Table of content makes it appear as if you have passed the test and therefore the related score is added.

    You will need to pass other tests to add on your score.

    Hope this helps.

    hey, which plugin would you recommend as least affecting the website speed?

    Anas
    Rank Math business

    Hello,

    Following are the table of content plugins supported by Rank Math:

      WP Shortcode Pro
      WP Shortcode
      TOC Pack – Table of contents for Elementor
      Ultimate Blocks
      LuckyWP Table of Contents
      Elementor Pro

    I hope this helps. Looking forward to helping you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)

The ticket ‘Table of contents’ is closed to new replies.