Hello,
Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.
Th filter that you have mentioned only works when adding TOC from third party plugins. I can suggest that you use one of the following snippets to disable this test.
If you are using the classic editor to edit your post, please add the following code snippet to your theme’s functions.php file:
/**
* Rank Math snippet to disable 'titleHasNumber' & 'contentHasTOC' tests.
*
* @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 );
If you are using the block editor, please add this code instead:
add_filter( 'rank_math/researches/tests', function( $tests, $type ) {
unset( $tests['contentHasTOC'] );
return $tests;
}, 10, 2 );
Looking forward to helping you. Thank you.
@Michael Davis
Thanks for support, but i try in function.php (i use Classic Editor )
add_filter( 'rank_math/researches/tests', function( $tests, $type ) {
unset($tests['content-readability']['contentHasTOC']);
$tests['basic']['keywordInMetaDescription']['score'] = 4;
return $tests;
}, 10, 2 );
but my site Content Readability note is Use Table of Content to break-down your text.
How to debug?
Thanks!
-
This reply was modified 5 years, 7 months ago by
Dinhs.
unset( $tests['contentHasTOC'] ); working for me (i user a builder element). But seo-score in edit post not equal in all Post? My score in edit post = 100 but in all Post = 93.
Thanks.
I think my cache page. Now all bug be processed. I have control this Plugin.
Good Plugin. Thanks 🙂
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.