Term description does not strip shortcodes

#60522
  • Resolved Zhao Han
    Rank Math free

    If I edit a tag description to

    [su_permalink id=”1136″]install ROS Noetic on Ubuntu 20.04[/su_permalink]

    It simply return $wp_query->queried_object->description (in “class-term-variables.php”, line 105).

    Ideally it should remove su_permalink.

    • This topic was modified 3 years, 10 months ago by Zhao Han.
Viewing 3 replies - 1 through 3 (of 3 total)
  • I changed

    `
    return $wp_query->queried_object->description;
    `

    to

    `
    $term_desc = $wp_query->queried_object->description;
    $term_desc = do_shortcode($term_desc);
    return $term_desc;
    `

    After that change, the front end preview is still showing the short codes.

    Alberto
    Rank Math business

    Hello,

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

    You can allow the addition of shortcodes to the meta description by adding the following snippet to your theme’s functions.php file:

    /**
     * Allow shortcodes in the Meta Data.
     */
    add_filter( 'rank_math/paper/auto_generated_description/apply_shortcode', '__return_true' );

    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.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘Term description does not strip shortcodes’ is closed to new replies.