Title: Execute shortcodes in feed excerpt
Last modified: August 19, 2016

---

# Execute shortcodes in feed excerpt

 *  [Aldo Latino](https://wordpress.org/support/users/aldolat/)
 * (@aldolat)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/execute-shortcodes-in-feed-content/)
 * Imagine a shortcode[1] that retrieves a link from a custom field and transforms
   a word or a phrase into an HTML formatted `a` element, so for example:
 *     ```
       Please, [link]check it out[/link] and let me know.
       ```
   
 * will be transformed into:
 *     ```
       Please, <a href="http://wordpress.org">check it out</a> and let me know.
       ```
   
 * This shortcode works fine in the content and in the feed content, but not in 
   the feed excerpt, which will be outputted as:
 *     ```
       Please,  and let me know.
       ```
   
 * clearing the part inside the shortcode.
 * Is there a way to tell WordPress to execute this shortcode in feed excerpt? Or,
   better, how to tell WordPress to execute this shortcode in feed excerpt only 
   if the post has a particular post format (‘link’, for example)?
 * I make this question because some planets do not retrieve the complete feed content
   for each post but only the excerpt.
 * Thanks in advance.
    Aldo
 * [1] The shortcode I am using is this:
 *     ```
       add_shortcode( 'link', 'ubn_externalLinks' );
   
       function ubn_externalLinks( $atts, $content = null ) {
       	global $wp_query;
   
       	$output = '<a class="external" href="' . htmlspecialchars( get_post_meta( $wp_query->post->ID, 'External_links', true ) ) . '" rel="bookmark">' . $content . '</a>';
   
       	return $output;
       }
       ```
   

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

 *  [rlgrobert](https://wordpress.org/support/users/rlgrobert/)
 * (@rlgrobert)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/execute-shortcodes-in-feed-content/#post-2053125)
 * Hello, did you ever find a solution for this? I need to do the same thing.
 *  Thread Starter [Aldo Latino](https://wordpress.org/support/users/aldolat/)
 * (@aldolat)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/execute-shortcodes-in-feed-content/#post-2053126)
 * Hello,
    No, I didn’t. 🙁 I should take a look into the function that creates 
   the excerpt, but for now I do not have much time available.
 * I the case I resolve it, I will inform you here.
 *  Thread Starter [Aldo Latino](https://wordpress.org/support/users/aldolat/)
 * (@aldolat)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/execute-shortcodes-in-feed-content/#post-2053127)
 * rlgrobert,
    try this plugin: [http://wordpress.org/extend/plugins/advanced-excerpt/](http://wordpress.org/extend/plugins/advanced-excerpt/)
 * It should fit your needs.

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

The topic ‘Execute shortcodes in feed excerpt’ is closed to new replies.

## Tags

 * [content](https://wordpress.org/support/topic-tag/content/)
 * [excerpt](https://wordpress.org/support/topic-tag/excerpt/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Aldo Latino](https://wordpress.org/support/users/aldolat/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/execute-shortcodes-in-feed-content/#post-2053127)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
