Title: [Plugin: Column Shortcodes] Using plugin removes Excerpts
Last modified: August 20, 2016

---

# [Plugin: Column Shortcodes] Using plugin removes Excerpts

 *  Resolved [davidmcc3](https://wordpress.org/support/users/davidmcc3/)
 * (@davidmcc3)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-column-shortcodes-using-plugin-removes-excerpts/)
 * When I put shortcodes into a post, the Excerpt disappears. Has this been mentioned
   before? Can it be fixed?
 * [http://wordpress.org/extend/plugins/column-shortcodes/](http://wordpress.org/extend/plugins/column-shortcodes/)

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

 *  Plugin Contributor [Codepress](https://wordpress.org/support/users/codepress/)
 * (@codepress)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-column-shortcodes-using-plugin-removes-excerpts/#post-3110700)
 * This is the default way on how WordPress handles the excerpt. It will always 
   strip out the shortcodes.
 * I modified the excerpt function for you so you it will leave the shortcodes in
   place when using the excerpt. Just place this code in your functions.php:
 *     ```
       /**
        *  Trim the excerpt with shortcodes
        *
        */
       function wp_trim_excerpt_with_shortcodes($text = '')
       {
       	$raw_excerpt = $text;
       	if ( '' == $text ) {
       		$text = get_the_content('');
       		$text = apply_filters('the_content', $text);
       		$text = str_replace(']]>', ']]>', $text);
       		$excerpt_length = apply_filters('excerpt_length', 55);
       		$excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
       		$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
       	}
       	return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
       }
       remove_filter( 'get_the_excerpt', 'wp_trim_excerpt'  );
       add_filter( 'get_the_excerpt', 'wp_trim_excerpt_with_shortcodes' );
       ```
   
 * Let me know if this works for you.
 *  Thread Starter [davidmcc3](https://wordpress.org/support/users/davidmcc3/)
 * (@davidmcc3)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-column-shortcodes-using-plugin-removes-excerpts/#post-3110701)
 * Hi.
    Thanks for the code – not very confident with PHP, but will give it a try.

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

The topic ‘[Plugin: Column Shortcodes] Using plugin removes Excerpts’ is closed 
to new replies.

 * ![](https://ps.w.org/column-shortcodes/assets/icon-256x256.png?rev=1679769)
 * [Column Shortcodes](https://wordpress.org/plugins/column-shortcodes/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/column-shortcodes/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/column-shortcodes/)
 * [Active Topics](https://wordpress.org/support/plugin/column-shortcodes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/column-shortcodes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/column-shortcodes/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [davidmcc3](https://wordpress.org/support/users/davidmcc3/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-column-shortcodes-using-plugin-removes-excerpts/#post-3110701)
 * Status: resolved