The WordPress excerpt is the short summary that appears next to a post on archive pages, in RSS feeds, in search engine snippets, and anywhere a theme chooses to show “less than the full post.” It sounds simple, but it has three sources (manual, auto-generated, and meta description), two PHP functions that behave differently (
the_excerpt()
and
get_the_excerpt()
), and several filters that control its length, suffix, and formatting. The result is that “why does my excerpt look like that?” usually has more than one answer.
This guide covers where the excerpt comes from, how to write a manual one, how to control the auto-generated length and the “[…]” suffix, the difference between excerpts and SEO meta descriptions, and how to debug excerpts that show up wrong (truncated mid-sentence, stripped of formatting, or replaced with “…”).
The short answer#
Every WordPress post has an Excerpt field in the editor sidebar. If you fill it in manually, that text is the excerpt. If you leave it empty, WordPress auto-generates one by taking the first 55 words of the post content and trimming everything else.
To set a manual excerpt:
- Open a post in the block editor.
- In the right sidebar, click the Post tab (not Block).
- Expand the Excerpt panel.
- Type your summary – whatever length you want.
- Update the post.
To change the auto-generated excerpt length site-wide, add this to your child theme’s
functions.php
:
add_filter( 'excerpt_length', function( $length ) {
return 30;
}, 999 );
Replace
30
with however many words you want. The
999
priority makes sure your filter runs after any plugin filters that might also modify the length.
To change the “[…]” suffix that appears at the end of auto-excerpts:
add_filter( 'excerpt_more', function( $more ) {
return '... <a href="' . get_permalink() . '">Read more</a>';
} );
These two filters cover most of what people want from excerpts.
Where the excerpt actually comes from#
WordPress builds the excerpt from one of three sources, in this order of priority:
- The manual Excerpt field in the post editor. If you wrote anything there, that is the excerpt. WordPress stores it in the
post_excerptcolumn of thewp_postsdatabase table. - The auto-generated excerpt. If the manual field is empty, WordPress takes the first 55 words of the post body, strips all HTML and shortcodes, and appends “[…]” (or whatever the
excerpt_morefilter sets). - The full content in some legacy themes. If the theme calls
the_content()instead ofthe_excerpt()and there is no<!--more-->tag in the post, the entire post body is returned. This is technically not an excerpt, but it is what some themes ship with by default.
The theme decides which of these is shown by calling either
the_excerpt()
or
the_content()
in its archive templates.
the_excerpt()
always returns the manual or auto-generated excerpt – never the full post.
the_content()
returns the full post unless a Read More tag is present, in which case it returns everything before the tag. The two are mutually exclusive in a given template.
Writing a manual excerpt#
The manual excerpt is the cleanest path because it gives you complete control. Auto-generation has limits: it cuts at word 55 even if that splits a sentence, it strips HTML so links and bolding disappear, and it does not know what is interesting about the post.
When the Excerpt panel is missing from the sidebar, it has been hidden in screen options. Open the post, click the three-dot menu in the top right, choose Preferences > Panels, and enable Excerpt. In the classic editor, scroll to Screen Options at the top of the page and check Excerpt.
A few rules for writing manual excerpts:
- Keep them under 160 characters if you want them to also work as SEO meta descriptions in themes that fall back to the excerpt for the meta tag. (Most modern SEO setups use a separate field; see below.)
- Write as a complete thought – the auto-generated excerpt cuts mid-sentence, which makes it look broken. A manual excerpt should read as a self-contained summary.
- Do not duplicate the title. If your title already says “How to set up email forwarding in cPanel,” your excerpt should not say “This guide explains how to set up email forwarding in cPanel.” Add value: who it is for, what they will learn, why it matters.
- Plain text is safe. Some themes preserve HTML in manual excerpts, others strip it. If you want bold or italic for emphasis, or an inline link, test in your theme first – and see how to insert and edit hyperlinks in WordPress for the markup if you do hand-roll a link inside the excerpt field.
The manual excerpt is also what most RSS readers display, so it is doing double duty: it is the archive snippet and the feed teaser.
Changing the auto-excerpt length#
The default of 55 words is a holdover from very early WordPress and is rarely what anyone actually wants. Modern blog layouts work better at 20-30 words for card grids, 40-50 words for traditional list layouts.
The
excerpt_length
filter in
functions.php
(child theme) sets it globally:
add_filter( 'excerpt_length', function( $length ) {
return 25;
}, 999 );
The number is the word count, not character count. The high
999
priority pushes your filter to the end of the queue, so plugins that also modify excerpt length cannot override yours.
Block themes are different. Many block themes ignore
excerpt_length
because the auto-excerpting is handled by the Post Excerpt block in the Site Editor instead of by
the_excerpt()
directly. The Post Excerpt block has its own “Excerpt length” setting in the block sidebar – look for it when you are editing the Query Loop template. If you change the block’s setting, that value wins for that template; the PHP filter is ignored.
To find which one your theme is using: edit a Query Loop in the Site Editor, click into a Post Excerpt block, and check the right sidebar. If there is an “Excerpt length” slider, the block controls it. If no Post Excerpt block exists in the loop, the theme is calling
the_excerpt()
somewhere and the PHP filter still applies.
Changing the "[…]" suffix#
The default ellipsis-in-brackets is functional but ugly, and it does not link anywhere. Most sites benefit from replacing it with a “Read more” link to the post.
add_filter( 'excerpt_more', function( $more ) {
return '... <a class="excerpt-more" href="' . get_permalink() . '">Read more</a>';
} );
A few notes on this:
- The
excerpt_morefilter only fires when the excerpt is auto-generated. If a manual excerpt is set on a post, this filter is skipped – the manual text shows as-is, with no suffix added. (Many people get confused because they set this filter, then test on a post with a manual excerpt, and nothing changes.) -
get_permalink()inside the filter returns the URL of whatever post is currently being looped over. Each excerpt gets its own correct link. - Style the suffix with the class you added (
.excerpt-morehere) so it looks like a button or call-to-action rather than inline text.
To remove the suffix entirely, return an empty string:
add_filter( 'excerpt_more', function() {
return '';
} );
Why your excerpt sometimes shows as just "…"#
This is the most common excerpt bug. The excerpt panel is filled in, the post has plenty of content, but on the archive page only “…” (or the bracketed ellipsis) appears.
The cause is almost always: the theme is using
get_the_excerpt()
inside a custom layout, not
the_excerpt()
, and the implementation has a subtle difference in how it handles empty manual excerpts.
the_excerpt()
and
get_the_excerpt()
look almost identical:
-
the_excerpt()echoes (prints) the excerpt directly. Returns nothing. -
get_the_excerpt()returns the excerpt as a string for you to use however you want.
But under the hood:
the_excerpt()
automatically wraps the output in
<p>
tags and applies the
the_excerpt
filter chain.
get_the_excerpt()
returns just the raw text and applies a different (smaller) filter chain. If a theme uses
get_the_excerpt()
without manually triggering the missing filters, you can end up with stripped formatting, no auto-generated content, or the suffix-only “…” case.
To diagnose: open the theme template that renders the archive (often
archive.php
,
category.php
, or a template part inside
template-parts/
). Look for the function call. If it is
get_the_excerpt()
, you have two paths:
- Switch the theme to call
the_excerpt()instead (in a child theme override). - Wrap
get_the_excerpt()so that when it returns an empty string, you fall back to a substring of the content:
$excerpt = get_the_excerpt();
if ( empty( trim( $excerpt ) ) ) {
$excerpt = wp_trim_words( get_the_content(), 25, '...' );
}
echo $excerpt;
This is what most well-built themes do internally; broken ones just call
get_the_excerpt()
and hope for the best.
Excerpts vs SEO meta descriptions#
These two are often confused because they look similar – both are short summaries of a post – but they live in different places and are used by different things.
| Excerpt | Meta description | |
|---|---|---|
| Where it lives |
post_excerpt
field in
wp_posts
|
<meta name="description">
in HTML head |
| Set in | Excerpt panel in editor sidebar | SEO plugin (Yoast, Rank Math, AIOSEO) or theme settings |
| Used by | Archive pages, RSS feeds, themes | Search engines, social shares, browser previews |
| Length target | 25-50 words (~150-300 chars) | 150-160 chars (Google truncates beyond) |
| Plain text required | No, but recommended | Yes, no HTML allowed |
Some themes and SEO plugins use the excerpt as a fallback when no meta description is set. This is why writing a clean, complete-sentence manual excerpt is useful even on a site with a separate SEO plugin: when you forget to write the meta description, the excerpt picks up the slack.
But do not rely on this. The excerpt’s job is the archive page and RSS feed; the meta description’s job is search engines. Write them separately when the post is important enough to deserve a curated snippet for each surface.
If your site uses Yoast or Rank Math for SEO settings, the meta description field in those plugins is what lands in the HTML head, regardless of what the excerpt says.
Excerpts in custom post types#
Posts get the Excerpt panel by default. Pages, products, and custom post types do not – excerpt support is opt-in.
To enable the Excerpt field on Pages, add this to
functions.php
:
add_post_type_support( 'page', 'excerpt' );
For a custom post type registered with
register_post_type()
, add
'excerpt'
to the
supports
array:
register_post_type( 'portfolio', [
'public' => true,
'supports' => [ 'title', 'editor', 'thumbnail', 'excerpt' ],
// ...
] );
Once excerpt support is on, the Excerpt panel appears in the editor and
the_excerpt()
works in the templates that loop over those posts.
Excerpts in feeds#
The Settings > Reading screen has an option labeled “For each post in a feed, include” with two choices: Full text or Summary. Summary uses the excerpt; Full text uses the entire post body.
Most blogs run on Full text because it gives readers a better RSS experience – they can read the whole post in their feed reader without clicking through. Summary makes sense if your business model depends on driving traffic back to your site (ad-supported, affiliate-heavy, paywall behind login).
The summary feed uses
the_excerpt_rss()
internally, which calls
get_the_excerpt()
with feed-appropriate defaults. The same auto-generation rules apply: manual excerpt wins, auto-summary at 55 words is the fallback.
Hostney’s WordPress hosting plans include the platform-level page cache and object cache layered above your site, and excerpts on archive pages are cached aggressively along with the rest of the page HTML. After you change the excerpt or its length filter, clear the cache from the control panel – otherwise visitors will keep seeing the old text on archives even though the post itself is up to date.
Common excerpt issues and fixes#
A short troubleshooting list for the cases that are not “why is it just ‘…'”:
Excerpt shows the full post body. The theme is calling
the_content()
instead of
the_excerpt()
in the archive template. Two fixes: switch the theme call (in a child theme override), or use the Read More tag in each post to force a cut-off point that
the_content()
will respect.
Excerpt cuts mid-sentence. This is the auto-generator at 55 words. Either write a manual excerpt for that post, or shorten
excerpt_length
to a value that more often produces clean cuts (it will still occasionally split sentences, but less obviously at smaller lengths).
Excerpt is missing all formatting.
the_excerpt()
strips HTML by design. To preserve some tags, you need a custom filter that escapes everything except a whitelist:
add_filter( 'wp_trim_excerpt', function( $excerpt, $raw_excerpt ) {
if ( '' === $raw_excerpt ) {
$content = wp_strip_all_tags( get_the_content(), false );
return wp_trim_words( $content, 25, '...' );
}
return $raw_excerpt;
}, 10, 2 );
This bypasses the default trimming and lets the manual excerpt through with whatever HTML you wrote.
Excerpt is duplicated on the single post page. Some themes display the excerpt above the full post body on single-post pages. This is rare and usually intentional (magazine-style layouts). If you do not want it, look in
single.php
or the theme’s single-post template part for a
the_excerpt()
call and remove it.
Excerpt does not update after editing. Page cache or object cache holding the old version. Clear both layers (cache plugin or host control panel) after changing excerpts, especially if the excerpt is rendered inside a Query Loop block that caches its output.
Manual excerpt, auto-excerpt, and meta description - which to write#
For most posts, the right pattern is:
- Manual excerpt – 25-50 words, self-contained, complete sentences. Used on archive pages and RSS.
- Meta description in your SEO plugin – 150-160 characters, written for search snippets, includes the target keyword.
- Skip the auto-excerpt entirely – never let WordPress generate a “[…]”-cut summary. It is always uglier than something you write deliberately.
The auto-generator is a safety net for posts that you forgot to summarize, not a content strategy. Writing a manual excerpt takes ten seconds and removes the need to ever debug auto-generation behavior.
Summary#
The WordPress excerpt has three sources (manual field, auto-generated from content, fallback to full post), two retrieval functions (
the_excerpt()
and
get_the_excerpt()
) with different behaviors, and a handful of filters (
excerpt_length
,
excerpt_more
,
wp_trim_excerpt
) for fine-tuning. Manual excerpts are the cleanest path; the filters matter mainly when you have a lot of posts without manual summaries.
Excerpts and the Read More tag solve overlapping problems differently – the excerpt summarizes the post in a separate field, while the More tag cuts the post body itself at a point you choose. Themes pick one or the other in their archive templates. To set up posts that flow into archive pages cleanly, see how to add a blog to a WordPress site and how to add and manage categories for the structural side, and WordPress permalinks for SEO for the URL structure those archives live at.