Title: [post_excerpt] includes post shortcodes
Last modified: September 8, 2017

---

# [post_excerpt] includes post shortcodes

 *  Resolved [anghorpl](https://wordpress.org/support/users/anghorpl/)
 * (@anghorpl)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/post_excerpt-includes-post-shortcodes/)
 * Hi,
 * I really love your plugin. Yes it’s UI is kinda horrible, but after few minutes
   all is clear and it works like a charm… with some minor issues.
 * I’m using DIVI Bulder that creates lots of shortcodes inside the post. When trying
   to display excerpts from such posts I’m receiving shortcodes garbage before even
   first true word is displayed 😉
 * Any chances to update excerpts to work on escaped content string?
    -  This topic was modified 8 years, 9 months ago by [anghorpl](https://wordpress.org/support/users/anghorpl/).

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

 *  Thread Starter [anghorpl](https://wordpress.org/support/users/anghorpl/)
 * (@anghorpl)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/post_excerpt-includes-post-shortcodes/#post-9479589)
 * I believe this one should help:
 * [https://codex.wordpress.org/Function_Reference/strip_shortcodes](https://codex.wordpress.org/Function_Reference/strip_shortcodes)
 * EDIT: just reading source – it’s there… don’t know why shortcodes are still present
   🙁
    -  This reply was modified 8 years, 9 months ago by [anghorpl](https://wordpress.org/support/users/anghorpl/).
    -  This reply was modified 8 years, 9 months ago by [anghorpl](https://wordpress.org/support/users/anghorpl/).
 *  Thread Starter [anghorpl](https://wordpress.org/support/users/anghorpl/)
 * (@anghorpl)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/post_excerpt-includes-post-shortcodes/#post-9479668)
 * At this point the only option was to use
    `preg_replace('/\[\/?et_pb.*?\]/', '',
   $content);` inside your excerpt, which bring me idea for second optional parameter
   of [post_excerpt] – regex expression.
    -  This reply was modified 8 years, 9 months ago by [anghorpl](https://wordpress.org/support/users/anghorpl/).
 *  Plugin Author [EkoJR](https://wordpress.org/support/users/ekojr/)
 * (@ekojr)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/post_excerpt-includes-post-shortcodes/#post-9480983)
 * Yea, the UI has almost always been horrible, and a lot of it was due with it 
   being designed with HTML4.01, but with APL v0.3, HTML5 had just released. Designs
   during that time weren’t the best, and usually took extensive workarounds. However,
   things are different now days, and WordPress has also continued to improve, especially
   with the community and its guidelines/documentation.
 * That being said, there is a new version (v0.4 Early Beta) that focused on UI 
   and backend data structure. It’s still familiar, but the UI and UX is drastically
   improved. It is still in early beta, but I’ve been using it in production testing,
   and have a few more things I want to iron out.
 * You mentioned Divi, and I’ve commonly work with it with others. However, I see
   plenty of limitations where APL could improve or fill in. I’ve also been working
   on a project to extend and possibly support APL. Designs will also eventually
   become interchangeable. I am curious what other would think, but have held off
   on making any kind of announcements. At least until community support reaches
   a stable point
 * —————————–
 * In regards to the issue…
 * I do have the WP Function already added, but it good news to see you were able
   to quickly & easily navigate to the code…but I also took extra steps to make 
   it well documented. It’s possible Divi found a workaround. My worry is if it 
   is intentional by WordPress.
 * Simply for reference, the code…
 *     ```
       $encoding = mb_internal_encoding();
       $return_str = strip_shortcodes( mb_substr(
       	strip_tags( $this->_post->post_content ),
       	0,
       	$atts_value['length'],
       	$encoding
       ));
       ```
   
 * Adding code to integrate 3rd party is something I prefer not to do with APL being
   a public release. I do think adding custom filters to some of the internal shortcodes
   would help significantly, and it’s something I’ve slowly been doing as I work
   on the code.
 * I think I would mark this issue as “Add custom filters to Internal Shortcode(
   s) [post_excerpt]”
    -  This reply was modified 8 years, 9 months ago by [EkoJR](https://wordpress.org/support/users/ekojr/).
      Reason: Fixing code section

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

The topic ‘[post_excerpt] includes post shortcodes’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/advanced-post-list.svg)
 * [Advanced Post List](https://wordpress.org/plugins/advanced-post-list/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-post-list/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-post-list/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-post-list/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-post-list/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-post-list/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [EkoJR](https://wordpress.org/support/users/ekojr/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/post_excerpt-includes-post-shortcodes/#post-9480983)
 * Status: resolved