Hello,
Thank you for contacting Rank Math support.
You will have to add the following filter to use the global description when an excerpt is present:
add_action( 'rank_math/frontend/description', function( $description ) {
global $post;
$desc = RankMath\Post::get_meta( 'description', $post->ID );
if ( is_single()) {
$desc = RankMath\Helper::get_settings( "titles.pt_{$post->post_type}_description" );
if ( $desc ) {
return RankMath\Helper::replace_vars( $desc, $post );
}
}
return $description;
});
Here is how to add a filter to your site: https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Thank you Jaideep for your response. However, there is an issue.
Currently, with the provided code, the excerpt does not override the global settings, which is expected behavior. However, I would like the meta description entered in the single post editor (as shown in the attached image) to take precedence. In this scenario, the meta description should reflect the editor’s input, but the current behavior still displays the global settings.
Image –