Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author BuddyBoss

    (@buddyboss)

    @bj123,

    Plugin include the post description on the basis of post content, and shortcode also part of them. We will keep inside our todo list for future updates.

    You can try this:

    function remove_shortcode_from_search($content) {
      if ( is_search() ) {
        $content = strip_shortcodes( $content );
      }
      return $content;
    }
    add_filter('the_content', 'remove_shortcode_from_search');

    You should also think about writing a plain text excerpt.

    Thread Starter Bj123

    (@bj123)

    Thanks for the filter but it doesn’t remove the shortcodes on the global search. I put this in the child theme’s function php, right?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Avoid showing of shortcodes’ is closed to new replies.