WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Excerpt

The WordPress Excerpt is an optional summary or description of a post; in short, a post summary.

The Excerpt has two main uses:

  1. It replaces the full content in RSS feeds when the option to display summaries is selected in Dashboard › Settings › Reading.
  2. Depending on the WordPress theme, it can be displayed in places where quick summaries are preferable to full content:
    • Search results
    • Tag archives
    • Category archives
    • Monthly archives
    • Author archives

How to add excerpts to posts

To add an excerpt to a post, simply write one in the Excerpt field under the post edit box. An excerpt can be as short or as long as you wish. Usually, given its purpose, a couple of sentences is fine. If adding the excerpt manually, you may use (some) HTML formatting and the tags will not be stripped.

Note: As of WordPress version 3.1, some screen options on the Post & Page edit Administration Panels are hidden by default. The Excerpt field is hidden by default if it has not been used before.

Interestingly, since the WordPress excerpt is similar in purpose to the META description of (X)HTML documents, excerpts can additionally be used as meta descriptions too. Some themes do this by default. It can also be done by means of an SEO plugin or a plugin for managing data in the head of (X)HTML pages.

How to add a link beneath an excerpt to the full post

When using the excerpt feature WordPress does not automatically provide a link to a page containing the full post. To generate a link include the following code in the loop directly below <?php the_excerpt(); ?>

<a href="<?php echo get_permalink(); ?>"> Read More...</a>

Or put the following in your theme's functions.php.

function new_excerpt_more( $more ) {
	return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' . __('Read More', 'your-text-domain') . '</a>';
}
add_filter( 'excerpt_more', 'new_excerpt_more' );

Resources

This page is marked as incomplete. You can help Codex by expanding it.