Hello,
Thank you for contacting us and bringing your concern to our attention.
You can modify the following filter to change the meta description:
/**
* Allow changing the meta description sentence from within the theme.
*
* @param string $description The description sentence.
*/
add_filter( 'rank_math/frontend/description', function( $description ) {
return $description;
});
You can also follow this URL to check the available filters we have for the meta data: https://rankmath.com/kb/filters-hooks-api-developer/#metadata
Hope that helps and please don’t hesitate to let us know if you have any other questions.
Thank you.
Thanks for the reply. I understood, this way I can change the description.
But if I want to read it out, how would I do this?
Hello,
Thank you for providing additional information.
Rank Math stores the description value in rank_math_description meta. You can use the following code to get this value:
get_post_meta( $post_id, 'rank_math_description', true );
or
RankMath\Paper\Paper::get()->get_description()
Hope that helps. If there’s anything else we can help you with, please let us know.
Thank you
Hello,
Glad that helped.
Please feel free to reach out to us again in case you need any other assistance.
We are here to help.
Thank you.