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.
We’ve checked the description from the URL you shared, and it is not cut off:
Hvilken menstruationstrusser er bedst i test? Vi har sammenlignet 7 menstruationstrusser og fundet de bedste modeller. Rapporten inkluderer mærker som WUKA og Imse Wimse.
Could you please confirm if you have already corrected it manually as you described?
Looking forward to helping you.
Hello,
Please check your site and confirm you do not have a custom filter/snippet to limit the SEO description character count.
We look forward to helping you.
Thank you.
When using the brand shortcode in any other area than the meta description, nothing is cut off. So, it seems like RankMath is cutting off the length. I have no custom filter/snippet to limit that – I don’t even know how to limit it. Is there a RankMath setting that can limit it? Please provide som help on this.
Hello,
Thank you for contacting support.
Our plugin truncates the global meta description to 160 characters as that is usually the most number of characters that search engines will show on SERPs.
You can see the code used for that here: seo-by-rank-math\includes\frontend\paper\class-singular.php
If you want to override that behavior you need to use some custom code to remove the limit with something like this:
add_action( 'rank_math/frontend/description', function( $description ) {
global $post;
if( $post ) {
$global_description = RankMath\Helper::get_settings( "titles.pt_{$post->post_type}_description" );
$description = RankMath\Helper::replace_vars( $global_description, $post );
}
return $description;
});
Don’t hesitate to get in touch if you have any other questions.
So, it is the intention that the meta descriptions are cut off, as I have explained? It is something RankMath does automatically?
Hello,
Yes, that is the default behavior in the description field.
However, you can use the filter we shared above to change that in Rank Math.
Looking forward to helping you.
Where can I add this in my code? Is it sufficient to add it as a code snippet (https://wordpress.org/plugins/code-snippets/)?
add_action( ‘rank_math/frontend/description’, function( $description ) {
global $post;
if( $post ) {
$global_description = RankMath\Helper::get_settings( “titles.pt_{$post->post_type}_description” );
$description = RankMath\Helper::replace_vars( $global_description, $post );
}
return $description;
});
Hello,
Yes, you can use that plugin and add the code as PHP.
Here’s a link for more information:
https://rankmath.com/kb/wordpress-hooks-actions-filters/#code-snippets-plugin
Looking forward to helping you.
You explanation does not explain why Rank Math then does not cut off this meta description, when it is too long (according to Detailed.com chrome extension): https://imgur.com/a/dlpNcF8
Hello,
From the screenshot you shared, the description is showing 159 characters.
As we mentioned above, the maximum characters would be 160 characters.
Looking forward to helping you.
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.