How to Change The Default Excerpt Length In WordPress

This blog post is a tutorial for people who want their blog posts to be more readable and user-friendly. For those who don’t know, a post’s excerpt is a short summary of what your post is about that readers will be able to see before clicking on it. To change the default excerpt length in WordPress, you just have to add some code lines into your theme or use a plugin.

What is the default excerpt length in WordPress?

The default excerpt length in WordPress is 55 words (words including spaces).

This number is used if you let WordPress geenrate the excerpt automatically. If you use the Excerpt field, this limit doesn’t exist.

Why you might want to change it

The default excerpt length is not very long- especially if you have a lot of content in your post. The more words in your excerpt, the less likely people are to click on the link because they see nothing of what’s being talked about.

If someone wants their blog posts to be shown with an excerpt that is more detailed than 55 words, then they would have to change it themselves -and this can become time-consuming if they are using lots of excerpts. Changing this default excerpt length allows different lengths to be set for each post.

If you’re using an SEO plugin, then having a short excerpt can harm your ranking -something that could be avoided by changing the default word count (which is why some people recommend using both plugins).

How to change excerpt length in WordPress

There are 3 ways to modify the excerpt length. The first one is to use the Excerpt field manually. Anyone can do this so we won’t mention it in detail.

Use excerpt_length filter

The WordPress excerpt_length filter, which is appropriately named, allows you to change the default length of your excerpts in your code. Use the following code to display 55 words in your excerpts: Insert this snippet of PHP into your functions.php file and modify the number to the amount of words you want to show in your excerpts.

You can modify the 55 number to one you need to show the excerpt length.

add_filter( 'excerpt_length', function($length) {
    return 55;
}, PHP_INT_MAX );

Use plugins

There are plugins which allow webmasters to adjust different excerpt settings. And its length is just one of those settings.

Advanced Excerpt

This plugin adds features that make WordPress’ default way of displaying excerpts even better. You get to choose which HTML markup will be included in the excerpt, with support for advanced features like custom classes and ID’s.

The plugin also includes settings for ellipsis character, last word or sentence at the end, how long you want an excerpt to be (by either character count or by words), and if it should include a read-more link.

Leave a Comment

Your email address will not be published. Required fields are marked *

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close