How to edit the WordPress excerpt length easily
Build stunning sites & stores like a pro. Read more
Don’t bother designing. 700+ prebuilt websites for you. Read more

How to edit the WordPress excerpt length easily

Tips tricks & all of the stuff you should know about Betheme

Furniture Website Design Examples To Inspire You
January 21, 2026
How to increase the WordPress memory limit
January 24, 2026
Furniture Website Design Examples To Inspire You
January 21, 2026
How to increase the WordPress memory limit
January 24, 2026
 

Your archive pages show massive walls of text where clean previews should appear. WordPress defaults to 55-word excerpts, but that rarely fits your actual needs.

Learning how to edit the WordPress excerpt length gives you control over post summaries across your entire site. Whether you're trimming content for mobile displays or expanding previews for detailed blog listings, the excerptlength filter offers precise customization.

This guide covers five methods to modify excerpt word limit settings: functions.php editing, plugin solutions, manual excerpt creation, theme-specific controls, and developer techniques for conditional excerpt lengths. Each approach works for different skill levels and use cases.

What is the WordPress Excerpt

WordPress excerpt is a summary text that displays shortened content from posts and pages across archive pages, search results, and homepage layouts.

The excerpt field appears in both the Classic Editor and Gutenberg editor as an optional post meta section. WordPress automatically generates excerpts by trimming the first 55 words from your post content when you leave this field empty.

Archive pages, blog listings, and RSS feeds pull this excerpt data to show preview snippets instead of full articles. The wptrimwords function handles the default text truncation process in WordPress core.

Understanding Excerpt Length Control

 

Default Excerpt Behavior in WordPress

WordPress core sets the default excerpt length at exactly 55 words. This number comes hardcoded into the excerptlength filter within the wp-includes directory.

The system strips all HTML tags from excerpts during automatic generation. Only plain text appears in the final post excerpt output, regardless of formatting in the original content.

WordPress adds "[...]" at the end of truncated excerpts through the excerptmore filter hook.

Character vs Word Count Limitations

WordPress measures excerpts in word limit rather than character count. The wptrimexcerpt function splits content at word boundaries, never mid-word.

A 55-word excerpt typically ranges from 250-400 characters depending on average word length. Technical content with longer terminology produces higher character counts than conversational writing.

Manual excerpts bypass the word count restriction entirely. You control the exact length when writing custom excerpt text in the post editor excerpt panel.

Theme-Specific Excerpt Handling

Many WordPress themes override the default excerpt settings through their theme functions file. Twenty Twenty-Three and similar modern themes often implement custom excerpt configurations.

Some themes call gettheexcerpt directly while others use theexcerpt function with modified parameters. The theme template structure determines which approach applies to your site.

Child theme modifications take priority over parent theme excerpt functions when both exist.

How to Change WordPress Excerpt Length with Functions.php

Accessing Functions.php File

Navigate to Appearance > Theme File Editor in your WordPress dashboard. The functions.php file appears in the right sidebar file list.

Editing the parent theme functions file risks losing changes during theme updates. Create a child theme first or use a code snippets plugin for safer customization.

The wp-content/themes/your-theme/ directory contains the functions.php file when accessing via FTP or file manager.

Writing Custom Excerpt Length Filter

Add this code to modify the default excerpt length:

 function customexcerptlength($length) { return 30; } addfilter('excerptlength', 'customexcerptlength'); 

The excerptlength filter accepts any integer value representing word count. Replace 30 with your preferred number.

This excerpt length code snippet hooks into WordPress core before excerpt generation occurs. The addfilter function registers your custom callback with priority 999 by default.

Save the file after adding the code.

Testing Modified Excerpt Length

Clear your site cache after implementing functions.php excerpt length code. Cached versions display old excerpt formatting until the cache expires or refreshes.

Visit any archive page, category listing, or blog index to verify the new post excerpt length. Count the visible words to confirm the filter applies correctly.

The excerptmore filter requires separate modification if you want to change the "[...]" suffix text.

How to Edit Excerpt Length Using Plugins

Classic Editor Plugin Method

Install the Classic Editor plugin to restore the traditional WordPress post editing interface. The excerpt panel appears below the main content editor in the right sidebar.

Type your custom summary directly into this excerpt field. Manual excerpts ignore all automatic excerpt word limit settings and excerpt character count restrictions.

This approach works best when you need different excerpt lengths for individual posts rather than site-wide changes.

Advanced Excerpt Plugin Configuration

The Advanced Excerpt plugin provides granular control over excerpt generation without touching code. Install it from the WordPress plugin repository.

Settings include exact word count, character limits, excerpt HTML tags preservation, and custom ellipsis text. The plugin interface appears under Settings > Excerpt in your dashboard.

Advanced Excerpt handles both automatic and manual excerpt scenarios with separate configuration options for each.

WPCode Snippet Plugin Implementation

WPCode plugin offers a code snippets manager that's safer than editing functions.php directly. Create a new PHP snippet and paste your custom excerpt length filter code.

Toggle snippets on or off without file editing. Changes take effect immediately after activation.

The plugin maintains your customizations through theme updates and switches, unlike direct theme functions file modifications.

Manual Excerpt Control Methods

Post Editor Excerpt Field

Open any post in the WordPress editor. Look for the Excerpt panel in the right sidebar under Post settings.

Click to expand if collapsed. Type your custom post summary text directly into this field.

Manual excerpt creation overrides all automatic generation rules, giving you complete control over the displayed preview content.

Block Editor Excerpt Panel

The Gutenberg editor places the excerpt field in the Post tab of the right sidebar. Scroll down past Featured Image and Categories to locate it.

Write your custom excerpt using plain text only. The block editor excerpt doesn't support formatting, images, or HTML markup.

Leave blank to trigger automatic excerpt automatic generation based on your site's configured word limit.

Custom Excerpt Creation

Write excerpts that summarize your main points in 1-2 sentences. Front-load the most compelling information to maximize click-through rates from archive pages.

Keep custom WordPress excerpt length between 20-40 words for optimal mobile display. Longer excerpts get truncated on smaller screens regardless of your settings.

Include relevant keywords naturally but avoid stuffing. Search engines index excerpt content as part of your post meta data.

Theme-Based Excerpt Customization

Child Theme Functions Modification

Create a child theme to preserve excerpt customizations during parent theme updates. Add your excerptlength filter to the child theme's functions.php file instead of the parent.

The child theme's theme excerpt function executes after the parent theme loads. Your custom settings override any parent theme excerpt configurations automatically.

Theme Customizer Excerpt Settings

Some premium WordPress themes include built-in excerpt controls under Appearance > Customize. Look for sections labeled Blog, Archive, or Post Settings.

These native options modify excerpt behavior without code. Changes apply instantly in the customizer preview panel before publishing.

Page Builder Excerpt Options

Elementor, Beaver Builder, and similar page builders offer excerpt widgets with adjustable excerpt word limit settings. Each widget controls its own excerpt length independently from your site-wide defaults.

The excerpt display control appears in the widget settings panel under Content or Layout tabs. Adjust the number slider to set word count per widget instance.

Developer Solutions for Excerpt Length

Custom Post Type Excerpt Variations

Apply different excerpt lengths to custom post types using conditional logic:

 function customexcerptlength($length) { if (getposttype() == 'portfolio') { return 20; } return 55; } addfilter('excerptlength', 'customexcerptlength'); 

Portfolio posts display 20-word excerpts while standard posts keep the default 55-word length. Replace 'portfolio' with your custom post type slug.

Category-Specific Excerpt Length

Set unique excerpt lengths for different categories through WPQuery parameters. The excerpt length customization applies only to posts within specified category IDs.

Use hascategory() or incategory() functions inside your excerptlength filter callback function to check post categorization before returning word count values.

Conditional Excerpt Display Logic

Control excerpt visibility and length based on page context. Archive pages might show 30-word excerpts while search results display 50 words.

Add isarchive(), issearch(), or ishome() conditional checks within your filter function. The WordPress excerpt API evaluates these conditions during excerpt generation.

Troubleshooting Excerpt Length Issues

Excerpt Not Displaying After Code Changes

Flush your site's object cache and page cache after adding excerpt length filter hook code. W3 Total Cache, WP Rocket, and similar plugins cache generated excerpts until manually cleared.

Check for PHP syntax errors in your functions.php file. A single missing semicolon or bracket prevents the entire file from executing, breaking your WordPress excerpt length function.

Theme Override Conflicts

Some themes call theexcerpt() with hardcoded parameters that ignore your filter settings. Search your theme template files for direct wptrimwords() calls with fixed word counts.

The template hierarchy determines which file renders excerpts. A custom archive-portfolio.php template might bypass your global excerpt settings completely.

Cache Clearing Requirements

Excerpt changes require three cache types cleared: object cache, page cache, and browser cache. Server-level caching like Varnish needs separate purging through your hosting control panel.

CDN services cache excerpt content independently. Cloudflare, StackPath, and similar CDNs require manual cache purges after excerpt length code snippet implementation.

Excerpt Length Best Practices

SEO Considerations for Excerpts

Google indexes excerpt content as supplementary text for your posts. Write unique excerpts rather than duplicating your opening paragraph to avoid redundancy penalties.

Include target keywords in manual excerpts but maintain natural readability. The excerpt field content appears in some social media previews when Open Graph tags pull WordPress data.

Mobile Display Optimization

Mobile screens show roughly 30-40 words comfortably in excerpt previews. Longer excerpt character count values force awkward line breaks or get truncated by CSS.

Test your WordPress post excerpt length on actual mobile devices, not just browser responsive mode. Different screen sizes and font settings affect visible word count significantly.

User Experience Guidelines

Match excerpt length to your content type and audience. Technical blog posts need longer excerpts (50-75 words) to convey complex topics, while news sites work better with punchy 20-30 word summaries.

The excerpt read more link should appear naturally after your truncated text. Avoid cutting mid-sentence, which creates jarring reading experiences on archive pages and blog post previews.

I'm interrupting the article to tell you about BeTheme, the definitive multipurpose theme. If trying to satisfy multiple clients has become more stressful than rewarding, BeTheme is the solution for that.

BeTheme’s selection of hundreds of customizable, responsive pre-built websites is the highlight and a proven stress reducer.

The customizability of the theme makes it a dream come true for its users. There are 4 types of Page Builders that you can use with it: WPBakery, BeBuilder, and Elementor among them.

And now with the Live Builder, it’s even more impressive.

Check out BeTheme and see why our users love it!

The rest of the article is down below.

 

FAQ on How To Edit The WordPress Excerpt Length

What is the default WordPress excerpt length?

WordPress sets the default excerpt length at 55 words. This value comes hardcoded in the excerptlength filter within WordPress core files and applies automatically when you don't write manual excerpts in the post editor excerpt panel.

How do I change excerpt length without coding?

Use the Advanced Excerpt plugin or WPCode for no-code solutions. Both provide settings panels where you adjust word count through simple number fields. Manual excerpts in the post editor also bypass automatic length restrictions completely.

Where is the functions.php file located?

The functions.php file lives in wp-content/themes/your-theme-name/ directory. Access it through Appearance > Theme File Editor in WordPress dashboard or via FTP. Always edit the child theme version to preserve changes during updates.

Can I set different excerpt lengths for different post types?

Yes, use conditional logic inside your excerptlength filter function. Check getposttype() and return different word counts based on post type. Portfolio posts can show 20 words while blog posts display 50.

Why doesn't my excerpt length change after adding code?

Clear your site's object cache, page cache, and browser cache after implementing excerpt length code. Many caching plugins store generated excerpts until manually purged. Also check for PHP syntax errors in functions.php that prevent code execution.

How do I remove the [...] from excerpts?

Modify the excerptmore filter using addfilter('excerptmore', 'customexcerptmore'). Create a callback function returning your preferred text or empty string. This changes the default ellipsis that WordPress appends to truncated post content.

Do manual excerpts ignore the word limit?

Yes, manual excerpt creation bypasses all automatic excerptlength filter settings. Text entered directly in the excerpt field displays at whatever length you write, giving you complete control over individual post preview text across archive pages.

Can themes override my excerpt length settings?

Yes, some WordPress themes call wptrimwords() directly with hardcoded parameters that ignore your filter. Check theme template files for custom excerpt functions. Child theme modifications and plugins using higher filter priority can override theme settings.

How do I make excerpts longer on desktop than mobile?

Use CSS to hide excess text on smaller screens rather than changing excerpt word limit by device. Alternatively, implement JavaScript that detects screen size and applies different excerptlength values through AJAX-loaded content for responsive displays.

What's the ideal excerpt length for SEO?

Aim for 20-40 words that include target keywords naturally. Google indexes excerpt content as supplementary text, so write unique summaries rather than duplicating opening paragraphs. Mobile-friendly lengths perform better across all devices and search result previews.

Conclusion

Mastering how to edit the WordPress excerpt length transforms your site's archive pages, search results, and content previews. The excerptlength filter gives you precise control whether you choose functions.php modifications, plugin solutions, or manual excerpt creation.

Start with the method matching your technical comfort level. Code-based approaches using addfilter provide the most flexibility for custom post types and conditional display logic.

Plugins like WPCode and Advanced Excerpt work perfectly for those avoiding direct theme functions file editing. Manual excerpts in the Gutenberg editor remain the simplest option for individual post customization.

Test your excerpt customization across mobile devices and different archive layouts. Clear all caching layers after implementing changes to see results immediately on your WordPress site.

Albert Ślusarczyk
Albert Ślusarczyk
As the co-creator of Be Theme, I am a strong believer in designing with care and patience. I pour my energy, time & knowledge into perfecting the theme for our 260,000+ customers.
Buy now 700+website templates