Title: [Plugin: Network Latest Posts] Feed does not remove [] sortcodes
Last modified: August 20, 2016

---

# [Plugin: Network Latest Posts] Feed does not remove [] sortcodes

 *  Resolved [Aircut](https://wordpress.org/support/users/aircut/)
 * (@aircut)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-network-latest-posts-feed-does-not-remove-sortcodes/)
 * hello. i am having fun trying to get the plugin work correctly,
    it seems that
   in the post excerpt, shortcodes from other plugins are coming as raw text – that
   what i get
 * > Title
   > My Blog – Published on September 24, 2012 by author
   >  [vc_gallery title=”fruits:”
   > type=”flexslider_fade” interval=”3″ …more
 * is there a way to tell the script to use only post content and ignore short codes
   in the output?
 * [http://wordpress.org/extend/plugins/network-latest-posts/](http://wordpress.org/extend/plugins/network-latest-posts/)

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

 *  Plugin Author [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * (@iluminatus)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-network-latest-posts-feed-does-not-remove-sortcodes/#post-3071805)
 * Hi,
 * Are you using version 3.1.5 of Network Latest Posts? If so, is that “vc_gallery”
   plugin active?
 * If you’re using the latest version it shouldn’t be displaying those tags unless
   that gallery plugin isn’t being registered as a shortcode or tag and WordPress
   don’t recognize it as such, or it’s being escaped.
 * I just tested with my own plugin, here you can see the post: [Testing Excerpt Strips](http://testlab.8elite.com/2012/09/26/testing-excerpt-strips/)
 * > [nlposts title=’Testing Excerpt Strips’ title_only=false] Hi, this is the content,
   > when extracting excerpts the shortcode inserted before this line should be 
   > stripped, this is a proof NLPosts is working as expected.
 * And here under number 1 the results: [Displaying Excerpts](http://testlab.8elite.com/advanced-usage/displaying-excerpts/)
 * > TESTING EXCERPT STRIPS
   >  Hi, this is the content, when extracting excerpts the
   > shortcode inserted before this line should be stripped, this is a proof NLPosts
   > is working as …more
 * Finally, if you are displaying the vc_gallery shortcode as an example of usage
   like this: [[vg_gallery title=”fruits:” type=”flexslider_fade” interval=”3″]]
   it WON’T be stripped, this is because double square brackets are used to escape
   shortcodes and WordPress will recognize that line as a text string.
 *  Thread Starter [Aircut](https://wordpress.org/support/users/aircut/)
 * (@aircut)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-network-latest-posts-feed-does-not-remove-sortcodes/#post-3071844)
 * Thank you Jose for getting back to me, the shortcodes that are being unfiltered
   are from another plugin “Visual Composer for WordPress”
    [http://demo.wpbakery.com/vc/](http://demo.wpbakery.com/vc/)
   all its shortscods are being ignored…. and way around it?
 *  Plugin Author [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * (@iluminatus)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-network-latest-posts-feed-does-not-remove-sortcodes/#post-3071848)
 * Hi, I’m going to do some tests to see what’s happening with that plugin. As soon
   as I find a solution I’ll post it here.
 *  Plugin Author [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * (@iluminatus)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-network-latest-posts-feed-does-not-remove-sortcodes/#post-3071849)
 * Just to keep you up to date, I confirm those tags are not being stripped away.
   I’m working on a fix for this. I’ve changed the status of this topic to non resolved
   until I come up with a fix.
 *  Plugin Author [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * (@iluminatus)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-network-latest-posts-feed-does-not-remove-sortcodes/#post-3071850)
 * Ok, it’s fixed, or I think so, I’ve just uploaded the new version, it will be
   available in a minute or so. Apparently there exists an issue between Visual 
   Composer and strip_shortcodes WordPress hook which makes imposible to strip shortcodes
   generated by this plugin.
 * I solved the issue replacing the `strip_shortcodes` hook by a regex, if someone
   looks for a similar solution, here’s what I did:
 * I was stripping shortcodes and tags using this line:
 *     ```
       $content = strip_tags(strip_shortcodes($content));
       ```
   
 * Which works for almost every kind of shortcode and tag I can imagine, but for
   some reason it didn’t work with Visual Composer shortcodes, so I replaced that
   line by these two:
 *     ```
       $content = preg_replace("/\[(.*?)\]/i", '', $content);
       $content = strip_tags($content);
       ```
   
 * And that’s it, the first line removes everything between square brackets (shortcodes)
   and the second one strip tags.
 * I’m marking this topic as resolved, feel free to change it if v3.1.6 doesn’t 
   solve your issue.
 * Cheers.
 *  Thread Starter [Aircut](https://wordpress.org/support/users/aircut/)
 * (@aircut)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-network-latest-posts-feed-does-not-remove-sortcodes/#post-3071857)
 * wow that was fast!!! you are amazing! thank you!

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

The topic ‘[Plugin: Network Latest Posts] Feed does not remove [] sortcodes’ is 
closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/network-latest-posts_61c601.svg)
 * [Network Latest Posts](https://wordpress.org/plugins/network-latest-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/network-latest-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/network-latest-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/network-latest-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/network-latest-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/network-latest-posts/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Aircut](https://wordpress.org/support/users/aircut/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-network-latest-posts-feed-does-not-remove-sortcodes/#post-3071857)
 * Status: resolved