Languages: English • العربية • Español • Français • Português do Brasil • Русский • 日本語 • (Add your language)
The WordPress Excerpt is an optional summary or description of a post; in short, a post summary.
The Excerpt has two main uses:
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.
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' );
The manual WordPress excerpt is often confused with the automatic excerpt or with the teaser (the part of a post that appears on the front page when you use the More tag). While both are related to the manual excerpt, they are different from it.
The relationship between the three is this: When a post has no manual excerpt and the post template uses the the_excerpt() template tag, WordPress generates an excerpt automatically by selecting the first 55 words of the post. When the post template uses the the_content() template tag, WordPress will look for the More tag and create a teaser from the content that precedes the More tag.