Hello,
Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay and for any inconvenience this issue may have caused you.
You can use and modify this filter to disable the TOC test:
/**
* 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 );
Here’s a screencast using the Code Snippet Plugin:
https://i.rankmath.com/hmoG5p
Better yet: is it possible to mark the TOC situation as completed and only remove the title entry with numbers?
I’m sorry, could you please confirm if do you mean to remove the 1st line in the code you have sent?
I hope that helps. Thank you, and looking forward to your update.
Thank you for your response.
This is what I would like:
1) Have this item always marked as completed: “Use Table of Content to break-down your text.”. Also I always want to see it and not have it removed. I also want the score to be up right away.
2) I want to remove this item altogether: “Your SEO title doesn’t contain a number”. And I want the score to be summed up right from the start.
This is because I already have a TOC on my site, it’s just not accounted for by Rank Math since I created it in code. The number in the headline doesn’t bother me and I would like to eliminate it.
Thank you.
Hello,
Thank you for keeping in touch with us.
Please use this filter code instead and see if it resolves your problem:
add_filter( 'rank_math/researches/toc_plugins', function( $toc_plugins ) {
$toc_plugins['seo-by-rank-math/rank-math.php'] = 'Custom ToC';
return $toc_plugins;
});
If the issue persists, please let us know. Looking forward to hearing an update from you. Thank you.
Great, thank you very much.
This code works for TOC.
What about: “Your SEO title doesn’t contain a number” under “Title Readability”?
How can I remove it and increase its score?
Thank you.
Hello,
Glad to know that your first issue is resolved.
For the SEO Title, please refer to the following article: https://rankmath.com/kb/score-100-in-tests/#number-in-title
You can ignore the message if you don’t want to add a number to your title as these are just best practices that would help to ensure that your post performs better and should not be followed religiously.
Hope this helps. Let us know if you need any further assistance.
Thank you for your response.
Is it not possible to remove it altogether and increase its score in each article?
Hello,
You can’t remove it without adding a number in your title. If you will use a number in your title then the message will not appear and the score will also increase.
But as I mentioned in the previous message, you can ignore it if you don’t want to add a number to your title.
Hope this helps. Let us know if you need any further assistance.
I am aware that the Rank Math score is just a score compiled by you and has no direct effect for SEO, but I would like to be able to remove that entry and set that extra score in all articles whether the number is in the title or not.
Is that possible? Thank you.
Hello,
Thanks for your reply!
Please add the below code at the end of your theme’s function.php file and see if that fixes the issue:
add_filter( 'rank_math/researches/tests', function( $tests, $type ) {
unset(
$tests['titleHasNumber'],
);
return $tests;
}, 10, 2 );
Please let us know how it goes.
Thanks!
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.