How to change the excerpt length in WordPress?

By default, the length of a WordPress post excerpt is 55 words. However, You can easily increase or decrease this length using excerpt_length filter.

Useful Read : How to change or remove “Howdy” text on WordPress admin bar?

To change the excerpt length paste the following code in your functions.php file.

//change the excerpt length in WordPress
function ccw_change_excerpt_length( $length ) {
	return 20;
add_filter( 'excerpt_length', 'ccw_change_excerpt_length', 999 );

Note:  Change the number “20” to your preferred word count.


Leave a Comment.