Regarding plugin development:

#1023325
  • I am developing a TOC (table of contents) plugin. However, the Rankmath plugin is not recognizing my developed TOC plugin, and it shows that the TOC is missing in the SEO check section. Is there any special parameter required to recognize the TOC?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    Unfortunately, Rank Math only detects the Table of Contents if it is added with the compatible plugins from our list.

    However, you can add the following piece of code to your theme’s functions.php file to disable the TOC test from Rank Math:

    /**
     * Filter to disable the table of contents test
     */
    add_filter( 'rank_math/researches/tests', function( $tests, $type ) {
        unset(
            $tests['contentHasTOC'],
        );
        return $tests;
    }, 10, 2 );

    Here’s another way to apply the filter using the rankmath.php file:
    https://rankmath.com/kb/filters-hooks-api-developer/#adding-filters-and-hooks-in-rank-math-php

    Please note that these tests are only there for your reference to help you in optimizing your pages/post content. If you feel any of them doesn’t apply to your page or have already done them, please feel free to ignore them.

    Looking forward to helping you.

    Thank you. I applied the filter you suggested to the rankmath.php file.
    It was very helpful information.
    Have a great day!

    Hello,

    You’re welcome.

    We are super happy that this issue has already been resolved. If you have any other questions in the future, know that we are here to help you.

    If it isn’t too much to ask for – would you mind leaving us a review here?
    https://www.trustpilot.com/evaluate/www.rankmath.com
    https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post

    It only takes a few minutes but it makes a huge difference.

    It would mean so much to us and would go a really long way.

    Thank you.

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

The ticket ‘Regarding plugin development:’ is closed to new replies.