WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. justfreebies
    Member
    Posted 4 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
    Member
    Posted 4 years ago #

    is anyone offering help?

  3. cambia
    Member
    Posted 4 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,
    Avantix

  4. Anydog
    Member
    Posted 3 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
    Member
    Posted 3 years ago #

    damn regex...
    much appreciated code
    thx

Topic Closed

This topic has been closed to new replies.

About this Topic