How to remove short code from post excerpt (5 posts)

  1. justfreebies
    Posted 6 years ago #

    How do i remove the shortcodes from my homepage. As you can see on http://hiphopcanvass.com the post excerpt is showing the shortcodes output as codes

  2. justfreebies
    Posted 6 years ago #

    is anyone offering help?

  3. cambia
    Posted 5 years ago #

    Hello, I,ve visited your site and I don't see any problem with shortcodes.

    In case you are still interested, I had the same problem you have, and I solved it with the following line:

    $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text);

    This regular expression does the job. Just use it befero you echo the post excerpt.

    Good Luck,

  4. Anydog
    Posted 5 years ago #

    Hi ! Well, just what I needed. In fact, I had a problem with WP AutoSuggest plugin, which works great (for now), except it was showing the_content or the_excerpt with shortcode (from NGGallery plugin), which I don't want.
    So, anyway, thank you ...

  5. brasofilo
    Posted 5 years ago #

    damn regex...
    much appreciated code

Topic Closed

This topic has been closed to new replies.

About this Topic