1. Home
  2. Knowledge Base
  3. Why isn’t Rank Math Detecting the Table of Contents?

Why isn’t Rank Math Detecting the Table of Contents?

You might have come across scenarios where Rank Math is not able to detect the table of contents. In this article, we will discuss why Rank Math is not able to detect the table of contents and what you can do about that…

Rank Math will check for the presence of a table of contents creation plugin on your site. Assuming that you will use the table of contents and you have the plugin installed Rank Math can detect the Table of Contents if any one of the below-supported plugins is used:

However, if you do not have any of the above plugins installed then you need to add the following piece of code in your ‘functions.php’ file:

/**
 * Filter to add plugins to the TOC list.
 *
 * @param array TOC plugins.
 */
add_filter( 'rank_math/researches/toc_plugins', function( $toc_plugins ) {
       $toc_plugins['plugin-directory/plugin-filename.php'] = 'Plugin Name';
    return $toc_plugins;
});

Once you add the above piece of code then Rank Math can detect that you are using a Table of Contents section in your posts. We recommend adding this to a Child Theme so that even when your theme developer releases updates to your main theme, changes are not overridden.

Was this article helpful?

Still need help?

?

Submit Your Question

Please give us the details, our support team will get back to you.

Open Ticket