Skip to main content

WordPress – Change Post Excerpt Length

Submitted by admin on Fri, 12/10/2021 - 22:32

Default WordPress Post Excerpt Length

By default excerpt length of posts is set to return 55 words. But you may wish to change this value. In this tutorial, I will explain how to change the post excerpt length in WordPress.

How To Change Post Excerpt Length

Suppose, we want to change the excerpt length to 40 words.
Add following codes in functions.php file of your theme.

* Change the excerpt length to 40 words.
function custom_excerpt_length( $length ) {
  return 40;
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

Hope this article was helpful to you.

Tutorial Category