Header Text - How to Modify Excerpt Length in WordPress

WordPress excerpts are short summaries of your posts that appear on blog pages, archives, or search results. They give readers a quick preview of your content without showing the full article. If you already use WordPress, you may know that WordPress core and theme automate various things for you –excerpt length is one of them.

It automatically sets a default excerpt length. But did you know you can change it? This tutorial shows you what WordPress excerpts are, why adjusting their length matters, and how to change them.

You’ll also learn about a helpful plugin that makes managing excerpts easier. Whether you prefer manual changes or plugins, we’ll go step-by-step to customize your site for better readability and design.

KEY TAKEAWAYS

  • WordPress excerpts are short summaries or previews of your posts that appear on your blog page, archives, and search results.
  • The default WordPress excerpt length is 55 words, but you can change it to suit your website’s style and layout.
  • Customizing the excerpt length can improve your site design and make it more user-friendly by helping visitors quickly find the content they’re interested in.
  • You can change the excerpt length by manually editing the theme files or using plugins for an easier, no-code solution.
  • Adjusting the excerpt length can also improve SEO by giving search engines clear content previews of your posts.

WordPress Excerpt Length & Why Customize it?

A WordPress excerpt is a short snippet from your post that gives readers a quick preview of the content. It’s like a summary on your blog page, search results, or archives, helping visitors understand the post content before clicking.

By default, WordPress sets the excerpt length to 55 words, which answers the common question: how long is an excerpt? However, this default length may not always suit your site’s needs.

If the excerpt is too long or too short, it can affect how your content looks and how easily visitors can read it. Maintaining a consistent excerpt length ensures your site looks clean and professional.

Therefore, WordPress allows you to change excerpt length to fit your website’s design and style better. Customizing the length can improve readability, making it easier for visitors to scan your content.

It also gives you better control over your website layout, helping keep everything organized and visually appealing. Additionally, adjusting the excerpt length can boost SEO by providing clear content previews that help search engines better understand and rank your posts.

How to Change WordPress Excerpt

Changing the excerpt length in WordPress is simple and can be done in 2 ways:

  1. Change WordPress Excerpt Manually
  2. Use the Plugin to Change WordPress Excerpt.

Let’s start with the first approach below:

Change WordPress Excerpt Manually

To manually adjust the excerpt length, you’ll need to add a small piece of code to your theme’s functions.php file. This method is perfect for those comfortable editing WordPress files who want direct control over their site’s appearance.

It’s a great way to implement the functionality of letting WordPress change excerpt length directly in your theme without relying on plugins. Here’s how to do it:

Log in to your WordPress Dashboard. Go to Appearance Theme File Editor from the menu. Find and open the functions.php file in your active theme.  Now, add this code to modify the excerpt length: 

function custom_excerpt_length($length) {
    return 80; // Set the desired word count
}
add_filter('excerpt_length', 'custom_excerpt_length');

Lastly, click Update File to save the file and apply changes.

How To Change WordPress Excerpt Length - Change Excerpt Length

If using a block theme like Twenty Twenty-Two, edit the functions.php file within the WordPress Admin area.

Use an FTP client to connect to your web server and edit the functions.php file. You can refer to the following guides if you’re using FileZilla, an FTP client:

How To Configure A Site In FileZilla

How To Manage Files In FileZilla

How To Upload Files Using FileZilla

Change how you manage your website with Hosted.com’s WordPress Hosting, featuring exceptional speed, security and reliability.
With our expert support team always ready to assist you, you’ll have everything necessary for success.

However, in some themes like Twenty Seventeen, you need to edit the following two files to change the WordPress excerpt length:

  1. Edit functions.php File (you have just learned it – see above).
  2. Edit content.php File.

To edit content.php file, go to Appearance Theme File Editor. Scroll down to template-parts. Under this heading, navigate to post content.php.

Inside the content.php file, search for this line of code:

<div class="entry-content"> <?php

This is where your post content starts. You’ll be adding your new code right after this line. Next, add the following code snippet right below the line you just found:

if ( is_home() || is_category() || is_archive() ) { the_excerpt(); } else {

This code ensures the excerpt is shown on the home, category, and archive pages, while the full content will be shown on individual post pages. The WordPress the_excerpt() function generates and displays these excerpts efficiently.

Now, scroll down a bit further in the file to find these closing tags:

?> </div><!-- .entry-content -->

Then, add the following line right above the closing tags to properly close the if statement:

} // end of if statements

Once you’ve made all the changes, click Update File to save your edits. This will apply the new excerpt display settings to your site.

How To Change WordPress Excerpt Length - Edit content.php File in Twenty Seventeen Theme

Use Plugin to Change WordPress Excerpt

The Advanced Excerpt plugin or similar is an easier way to change your excerpt length. This plugin simplifies customizing your excerpts without needing any code. Here’s how to install and activate the plugin:

Go to Plugins Add New Plugin in your WordPress Dashboard. Search for Advanced Excerpt. Click Install Now, then click Activate to enable the plugin. Once the plugin is activated, follow these steps to set a custom excerpt length:

Go to Settings Excerpt. Adjust the word count to your desired length. You can also update other settings according to your requirements. Then, click Save Changes.

How To Change WordPress Excerpt Length - Customize Excerpt Length Using Plugin

Best Practices for Using Excerpts

Creating effective excerpts is important for user experience and website design. Here are some tips to help you craft the best excerpts:

  • Your excerpt should be short but provide enough information to spark the reader’s interest. Aim for clarity and focus on the post’s key point.
  • The excerpt should give a true preview of the full post, helping readers know what to expect if they click through.
  • Ensure the excerpt cuts off at a natural point, not in the middle of a sentence. This ensures the excerpt is still readable and makes sense.

In addition to crafting great excerpts, consistency in length is key across your site. Keeping your excerpts uniform in size will help maintain a clean, organized look. Whether on your homepage, category pages, or search results, a consistent excerpt length creates a more professional and pleasant reading experience for your visitors.

Strip Banner Text - Choose Hosted.com's WordPress Hosting for exceptional performance and expert support. [Get started]

FAQs

What is the best excerpt length for SEO?

There’s no perfect length for your WordPress website; keep your excerpts between 30 and 60 words for a good balance. A concise, well-written excerpt improves readability and user experience while giving search engines a clear content preview, which can help with indexing and rankings.

Does changing the excerpt length affect my website’s loading speed?

Changing the excerpt length generally doesn’t impact your WordPress website’s speed. However, if you use a plugin to manage excerpts, ensure it is optimized and doesn’t add unnecessary bloat to your site’s performance. For the best results, keep the plugin updated.

Will changing the excerpt length affect my theme’s design?

Yes, changing the excerpt length can impact your WordPress theme’s layout, especially if you have a layout with a grid or list. A longer or shorter excerpt can alter the page balance, so test and adjust your WordPress site design to ensure everything looks good after the modification.

How can I avoid cutting off words awkwardly in my excerpts?

To avoid awkwardly cut-off words, set a character limit instead of a word limit for your WordPress site’s excerpts. This ensures each excerpt is consistent and properly formatted, even if the content varies in length. Some plugins allow you to set this character limit for a cleaner look.

How can I make my excerpts more engaging for readers?

Make your WordPress site’s excerpts more engaging by using attention-grabbing words at the beginning. A compelling excerpt that clearly describes the post’s content encourages readers to click and read more. You can also include keywords to make the excerpt more relevant to search engines and visitors.

How to Update WordPress Plugins: A Step-by-Step Guide

How to Restore WordPress from a Backup: Best Practices

How To Use WordPress Tags Effectively And Their Purpose

How to Configure WordPress Settings After Installation

How To Create A Membership Website In WordPress