Disable TOC test snippet no longer working

#43674
  • Hi, after updating to the latest version of RankMath, the snippet in my functions.php that disabled the TOC test is no longer working. (I manually code the TOC)

    This is the snippet I have:

    add_filter( ‘rank_math/researches/tests’, function( $tests, $type ) {
    unset( $tests[‘content-readability’][‘contentHasTOC’] );
    $tests[‘content-readability’][‘contentHasShortParagraphs’][‘score’] = 5; // Added ToC score(2) to shortParagraphs test.
    return $tests;
    }, 10, 2 );

    Any advice would be appreciated.

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

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

    The password does not seem to work for the temporary user. Could you please check this?

    Please note that if you are editing your posts in Gutenberg, you will need to modify the code to the following:

    /**
     * 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 );

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Todd
    Rank Math free

    Hi Pascale,

    After entering the logins, I am getting a field to enter CleanTalk's Security authorization code which I don’t have.

    Can you please check?

    Also, are you using Block Editor or the Classic Editor?

    Hi Todd,

    That’s 2-factor authentication.
    The code is sent to the @ mentioned in the sensitive data section, the one connected to your login details.

    Hi Pascale,

    Thank you for the reply.

    Our team works in different timezones and unfrtunately the moderators don’t have access to this email address.
    Do you think your could temporaily disable the 2-factor authentication for 24 hours so that we can check this for you?

    We are looking forward to helping you. Thank you.

    Done.

    Hello,

    Thank you for the update.

    I have tried to add the code above to your functions.php file but it seems to require ftp access. Could you please replace your previous code with the one above and let us know how it goes.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hi Michael, thank you for that. Isn’t the code above for Gutenberg users? I am using the classic editor.

    In any case, this code works, thank you!

    Hello,

    Thank you for the feedback.

    We are glad your issue is now resolved. I am going to close this ticket, If you do have another question, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

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

The ticket ‘Disable TOC test snippet no longer working’ is closed to new replies.