What are WordPress excerpts?
WordPress excerpts are a short summary of a post or page.
Excerpts are commonly shown on Blog pages.
You might also see them on search results pages or archive pages.
Often there will be a link following the excerpt to read the full post.
Here’s an example from my blog page:
There are two types of excerpt:
- Manual excerpts
- Automatic excerpts
Manual excerpts are set by the post or page author in the Excerpt box under the post editor.
New WordPress users won’t see the Excerpt box. It can be turned on by checking the relevant box in Screen Options.
Another way of controlling the summary shown is to use the More tag in WordPress.
When writing a post, use the Insert Read More Tag button in the post editor.
On the blog page it looks like this:
This method doesn’t work for pages.
Automatic excerpts are auto-generated by WordPress.
How is this done?
The WordPress Codex entry for excerpt says:
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.
What does this mean in English?
In the first instance, WordPress will make an excerpt using the first 55 words of the post.
In the second, the text before the More tag in the post will make up a teaser.
Which method is followed depends on how your theme is coded.
How do themes handle excerpts?
Annoyingly, each theme is different – and there’s no easy way to search for how a theme handles excerpts.
Many themes will show excerpts (manual or auto-generated) on the Blog page e.g. Checathlon.
Some themes will ignore any manual excerpts and display the full post anyway on the Blog page. e.g. Twenty Sixteen.
Others will give the user a choice of what to display. This is often set in the WordPress Customizer.
My theme, Genesis, gives the option in Theme Options:
What about shortcodes?
If your post or page includes shortcodes you will likely want to set a manual excerpt.
This is so that the shortcodes don’t show up in your excerpts, like this.
This will look like gobbledegook to your readers!
Instead, write a manual excerpt that includes a few sentences from the page’s content.
Including links in WordPress excerpts
WordPress strips out all HTML from manual excerpts or text prior to the More tag. So links are not shown in excerpts.
To get around this issue you can use a plugin – Advanced Excerpt.
With the default settings of Advanced Excerpt, here’s how one of my posts looks in Checathlon theme.
Three things are there that weren’t in the auto-generated excerpt – the image, the subheading and the link.
Advanced Excerpt options
There are a few adjustments you could make to the output.
Ellipsis: Leave blank if you don’t want the excerpt to end with … Or add another HTML entity.
Excerpt length: Default is 40 but you can increase or decrease it or choose characters instead of words.
Finish: Choosing Sentence makes the excerpt end at the end of a sentence rather than cutting off in the middle.
Read more link: Adds a link at the end of the post, which is customizable. Redundant if your theme has a “Read more”, “Continue Reading” or similar link built in.
No custom excerpt: If you’ve set a manual excerpt that you want to use, check this box to retain it. Note that your manual excerpt won’t include any links or other tags.
Disable on: Disables Advanced Excerpt in certain places e.g. your home page.
Strip tags: Removes all tags except any you choose to keep. To keep links, check the box for the
Here is another example with the following options:
- Ellipsis: »
- Finish: Sentence
- Remove all tags except the following: a
The only downside of this plugin is that the excerpts are automatic.
Here’s some code you could try if you want manual excerpts with links. It needs to be added to
Further reading: How To Add Functions To Your WordPress Site Safely
You’ll also need to copy and paste the text and links you want in the excerpt from the Text view of WordPress to the Excerpt box so they retain links.
Found this helpful? Why not share this post!