How to Change the Excerpt Length in WordPress? – 3 Easy Way

How to Change the Excerpt Length in WordPress? - 3 Easy Way

When observing or viewing a Website, mainly WordPress blogs, you will notice the post content is not displayed entirely on the blog page or homepage.

Instead of that, just a small part of the full content is displayed. That piece of content is called an excerpt.

Anyway, sometimes, a title maybe not much enough to grab readers’ attention, and it does not sustain the quality of content that well.

A post excerpt is a small summary that we show to readers to get their interest in full post-reading. Right?

Note: By default, the Mostly WordPress theme shows a limit of 55 words in an excerpt. However, you can change this limit in many ways – with code and without code.

In this basic guidepost, I will show you how you can change the excerpt/post summary length on the WordPress website easily.

To show a post summary, the_excerpt() is used.

In a WordPress theme, it is mainly used in the following ways:

  • Category Archives
  • Tag Archives
  • Search Results
  • Monthly Archives
  • Author Archives
  • RSS Feeds

Several ways to limit & customize post excerpt length

  • Control post summary by adding ‘read more’ tag.
  • Enable custom excerpt option in WordPress.
  • Control excerpt length using filters.

01. How to add ‘Read More’ tag in your post

You can easily insert the ‘Read More’ tag while editing your post content. Place the text cursor where you want the excerpt to be stopped and use the Insert Read More’ tag button to add the ‘Read More’ link.

How to Change the Excerpt Length in WordPress - How to add ‘Read More’ tag in your post

02. Enabling Custom Excerpt to Write Your Own Post Summary

Enabling the post excerpt option in WordPress Dashboard gives you the freedom to write your own post summary.

There is a helpful feature in WordPress Dashboard to show an additional field for custom post excerpts.

You need to follow the below-given easy steps to enable custom post excerpt in WordPress Dashboard.

Click on the ‘Screen Options’ placed at the top right corner of your Dashboard.

Enabling Custom Excerpt to Write Your Own Post Summary

Check the ‘Excerpt’ check box in the Screen Options panel.

Enabling Custom Excerpt to Write Your Own Post Summary

By enabling Excerpt, there is a new field, ‘Excerpt’, which can be seen below the post content editor.

Now enter your custom post summary or excerpt with your summary desired length.

Enter your custom summary with the desired length
Enter your custom summary with the desired length

03. Control Excerpt Length Using WordPress Filters

Luckily WordPress has a built-in filter named “excerpt_length” that will allow you to customize the default WordPress excerpts length of your theme.

To change this default WordPress post excerpt length to 25 words using the WordPress “excerpt_length” filter, add the following piece of code into your functions.php file in your WordPress theme(I always recommend using the WordPress child theme):

function mhr_excerpt_length( $length ) {
	return 25;
}
add_filter( 'excerpt_length', 'mhr_excerpt_length', 999 );
Control Excerpt Length Using WordPress Filters
Add the following piece of code into your functions.php

This way, you can control the post excerpt’s length.

Note: Please use WordPress child-theme functions.php to add/update custom PHP codes. If you don’t have the proper skill to do that, activate and use the Code Snippets plugin on your WordPress website without breaking your WordPress website.

I hope you find this basic guide useful; try to implement these methods in your theme or post.

If you face any difficulty, do let me know. Thank you.