Shortcodes are not rendered in META

#472439
  • Resolved Johan W
    Rank Math free

    Bug with your plugin. We use shortcodes to render product category description in Woocommerce and the output is:

    <meta name="description" content="[category-content id="629"]"/>
    <meta property="og:description" content="[category-content id="629"]" />
    <meta name="twitter:description" content="[category-content id="629"]" />

    Is there a fix?

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.

    Our plugin doesn’t accept WordPress shortcode in the meta as we are making use of variables.

    To fix that, you need to create a custom variable from our filter code that generates the same output as your shortcode and insert that variable into our meta field instead:

    https://rankmath.com/kb/filters-hooks-api-developer/#add-extra-variables

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    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.

Viewing 1 replies (of 1 total)

The ticket ‘Shortcodes are not rendered in META’ is closed to new replies.