Title: Hide [Shortcode] from excerpt
Last modified: August 21, 2016

---

# Hide [Shortcode] from excerpt

 *  Resolved [katanaz](https://wordpress.org/support/users/katanaz/)
 * (@katanaz)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/hide-shortcode-from-excerpt/)
 * when i activate excerpt it also shows the shortcodes used in the post like this:
   [
   wc_row][wc_column size=”one-half” position=”first”]This game features an intense
   single-player campaign, a number of cooperative… it should look like this: “This
   game features an intense single-player campaign, a number of cooperative…”
 * the themes excerpt doese this fine. any way using the themes excerpt instead 
   of the plugins?
 * [https://wordpress.org/plugins/contextual-related-posts/](https://wordpress.org/plugins/contextual-related-posts/)

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

 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/hide-shortcode-from-excerpt/#post-4991676)
 * Hi,
 * The plugin strips out shortcodes using the `strip_shortcodes` function. Do you
   know what plugin / theme creates the wc_row shortcode?
 * You can write your own excerpt function to filter `crp_excerpt`. Something on
   the lines of this.
 *     ```
       function crp_overwrite_excerpt( $output, $id, $excerpt_length, $use_excerpt ) {
       $output = PUT A FUNCTION HERE TO GET THE THEME EXCERPT FOR $id
   
       return $output
       }
       add_filter( 'crp_excerpt', 'crp_overwrite_excerpt', 10, 4 );
       ```
   
 *  Thread Starter [katanaz](https://wordpress.org/support/users/katanaz/)
 * (@katanaz)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/hide-shortcode-from-excerpt/#post-4991749)
 * hi,
    shortcodes plugin: WP Canvas – Shortcodes & Shortcodes Ultimate Theme is:
   Hueman dont know where to find the themes funktion for excerpts 🙁
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/hide-shortcode-from-excerpt/#post-4991773)
 * You should ask the author of Hueman.
 *  Thread Starter [katanaz](https://wordpress.org/support/users/katanaz/)
 * (@katanaz)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/hide-shortcode-from-excerpt/#post-4991848)
 * i probably just need to edit how your plugin gets the excerpt to something like
   this
    `<?php echo strip_tags(get_the_excerpt()); ?>">` just need to know where
   i can edit this??
 *  Thread Starter [katanaz](https://wordpress.org/support/users/katanaz/)
 * (@katanaz)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/hide-shortcode-from-excerpt/#post-4991849)
 * already found the Function to create an excerpt for the post:
 *     ```
       function crp_excerpt( $id, $excerpt_length = 0, $use_excerpt = true ) {
       	$content = $excerpt = '';
       	if ( $use_excerpt ) {
       		$content = get_post( $id )->post_excerpt;
       	}
       	if ( '' == $content ) {
       		$content = get_post( $id )->post_content;
       	}
   
       	$output = strip_tags( strip_shortcodes( $content ) );
   
       	if ( $excerpt_length > 0 ) {
       		$output = wp_trim_words( $output, $excerpt_length );
       	}
   
       	return apply_filters( 'crp_excerpt', $output, $id, $excerpt_length, $use_excerpt );
       }
       ```
   
 * strip tags seems to be already build in but not working?!
    any idea?
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/hide-shortcode-from-excerpt/#post-4991852)
 * Hi,
 * That’s what I meant by my earlier reply. I already have `strip_shortcode` and`
   strip_tags` which strips out any HTML and inbuilt shortcodes.
 * Which is why I said maybe checking with the author of Hueman, if he is doing 
   anything special to ensure his shortcodes are stripped

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

The topic ‘Hide [Shortcode] from excerpt’ is closed to new replies.

 * ![](https://ps.w.org/contextual-related-posts/assets/icon-256x256.png?rev=2985705)
 * [Contextual Related Posts](https://wordpress.org/plugins/contextual-related-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contextual-related-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contextual-related-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/contextual-related-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contextual-related-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contextual-related-posts/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/hide-shortcode-from-excerpt/#post-4991852)
 * Status: resolved