Ready to get started?Download WordPress


WordPress SEO by Yoast
Feature Request: Apply shortcodes in meta description (3 posts)

  1. slz
    Posted 2 years ago #

    This is a great plugin, but it would be really nice to be able to put shortcodes into the meta description. As of now, any shortcodes placed there never run, and you end up with [shortcode] in the meta description.


  2. slz
    Posted 2 years ago #

    To anyone else that's wanting to run shortcodes in the meta description, here's how you can do it with WordPress SEO.

    Add this to your theme:

    add_filter('wpseo_metadesc', run_short_codes_in_meta_desc, 1337);

    function run_short_codes_in_meta_desc($metadesc)
    return do_shortcode($metadesc);

  3. dmatt85
    Posted 1 year ago #

    Thanks for this great solution, didn't work for me at first but did once I reduced the priority level from 1337 to 100

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic