• I am using the “blockquote” shortcode in my WooCommerce product descriptions. When a user is viewing the search results of a product, the shortcodes aren’t rendering, and are being output as plain text.

    Is there a way to render the shortcodes, or else a function to remove them in this scenario?

    Link: https://stickycoders.com/?s=swift

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • hannah

    (@hannahritner)

    Hey,
    Sorry for the delay. I just tested this on my test site and couldn’t get this issue to happen. Are you using the latest version of the theme as well as woocommerce?

    Hannah

    Hey,
    I would recommend using the woocommerce search so your products would show like they do in the shop page.

    But in terms of the normal wordpress search you can stript shortcodes from an excerpt with this custom function:

    add_filter('the_excerpt', 'kt_remove_shortcode_from_excerpt');
    function kt_remove_shortcode_from_excerpt($excerpt) {
      if ( is_search() ) {
        $excerpt = strip_shortcodes( $excerpt );
      }
      return $excerpt;
    }

    You would add that in a child theme functions.php file.

    If you need a child theme you can download one here: http://www.kadencethemes.com/child-themes/

    Kadence Themes

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

The topic ‘Search not rendering shortcodes’ is closed to new replies.