Title: the_excerpt() tag functionality
Last modified: August 19, 2016

---

# the_excerpt() tag functionality

 *  [ruzel](https://wordpress.org/support/users/ruzel/)
 * (@ruzel)
 * [18 years, 2 months ago](https://wordpress.org/support/topic/the_excerpt-tag-functionality/)
 * It would appear to me that the default functionality of the_excerpt() tag is 
   to fetch back a certain number of words from the body of a post and display them
   if there is no quicktag `<!--more-->` AND if there is no explicitly written excerpt
   in the excerpt field. That all makes sense. But it would also appear that the_excerpt()
   tag cleans out anchor tags. That is to say, if you have links in the first 30
   or 50 words of your post and you use the_excerpt() to fetch them, the anchor 
   tags are removed. Why would this be the default behavior? Why would you want 
   to override the author’s intended content? And more importantly, is there any
   way around this?
 * And before you suggest that I use the_content() tag, it should be pointed out
   that if you specifically query posts as opposed to using the loop, you will still
   have a problem since the `<!--more-->` quicktag is completely ignored.
 * So, in other words, it would appear to me that there is no way to query a set
   of specific posts (i.e. some one author’s posts) and show excerpts of those posts
   in a lists with their anchor tags intact. Am I correct in thinking this? It just
   doesn’t seem right.

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

 *  [nonletter](https://wordpress.org/support/users/nonletter/)
 * (@nonletter)
 * [18 years, 2 months ago](https://wordpress.org/support/topic/the_excerpt-tag-functionality/#post-733385)
 * have you tried the Scott Yang’s [search excerpt](http://scott.yang.id.au/code/search-excerpt/)?
   many customizations are possible
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [18 years, 2 months ago](https://wordpress.org/support/topic/the_excerpt-tag-functionality/#post-733393)
 * The default behavior of the_excerpt is to remove *ALL* tags. Excerpts are text
   only, they do not contain links or formatting, by definition.
 *  Thread Starter [ruzel](https://wordpress.org/support/users/ruzel/)
 * (@ruzel)
 * [18 years, 2 months ago](https://wordpress.org/support/topic/the_excerpt-tag-functionality/#post-733397)
 * Thanks nonletter. That looks like a highly useful plugin. I also found this nifty
   trick on another thread (from pifucan)
 * When making a specific query (such as `query_posts('category_name=conferences');`)
   in a template, if you then use `the_content` to show your posts, the more tag
   will be ignored. If you use the_excerpt, your formatting will be stripped. To
   get around this, create a global variable called `$more` and set it equal to 
   true before calling your query. And then, if afterwards you would like following
   posts to show their full content, you can set back to “true” after the query 
   is run; like so:
 *     ```
       <?php global $more; $more = false;
           query_posts('category_name=conferences');
           the_content('Continue Reading');
           //this last line is only necessary if you have more posts
           //to show in your template and want to show their full bodies,
           //not excerpts
           $more = true; ?>
       ```
   
 * You can find more info on this technique here

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

The topic ‘the_excerpt() tag functionality’ is closed to new replies.

## Tags

 * [anchor tags](https://wordpress.org/support/topic-tag/anchor-tags/)
 * [excerpt](https://wordpress.org/support/topic-tag/excerpt/)
 * [excerpts](https://wordpress.org/support/topic-tag/excerpts/)
 * [links](https://wordpress.org/support/topic-tag/links/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [the_content](https://wordpress.org/support/topic-tag/the_content/)
 * [the_excerpt](https://wordpress.org/support/topic-tag/the_excerpt/)

 * In: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
 * 3 replies
 * 3 participants
 * Last reply from: [ruzel](https://wordpress.org/support/users/ruzel/)
 * Last activity: [18 years, 2 months ago](https://wordpress.org/support/topic/the_excerpt-tag-functionality/#post-733397)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
