Is there a way to make the meta description recognise shortcodes?

Hello @cheonmu,

Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

If you’re using any shortcode on the meta description, please use the following filter on your website:

add_filter( 'rank_math/paper/auto_generated_description/apply_shortcode', '__return_true' );

Here’s how you can add filter/hook to your WordPress site: https://rankmath.com/kb/wordpress-hooks-actions-filters/

However, please note that this filter only works for the autogenerated title & description. It will not work if you directly add a shortcode in the snippet editor.

If you want to to get the shortcodes inside the snippet editor, the only viable option would be to create a variable that would parse the same value of the shortcode by editing the following filter: https://rankmath.com/kb/filters-hooks-api-developer/#add-extra-variables

Hope that helps and please don’t hesitate to let us know if you have any other questions.

Thank you.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer