Hi Randi,
Thanks for getting in touch with us.
When you choose the %excerpt%
for meta description, we grab whatever is present in the first paragraph of your page. In this case, it seems like that’s the YouTube URL.
You can get around this by using a custom meta description for pages like these.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Hi!
Thanks for your quick response. What you are referring to when you say add a custom meta description? Manually adding meta descriptions isn’t an option. I need a way to insert meta descriptions automatically with text below the video. Please advise. Thanks again for your help and support and I look forward to hearing from you.
Hello,
Thank you for contacting Rank Math today.
You can workaround this limitation by adding the following code snippet on your theme’s functions.php file:
/**
* 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 preg_replace('/\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i', '', $description);
});
Please note that this will only change the description on the frontend and not the on the backend Rank Math metabox.
Looking forward to helping you. Thank 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.