Home » Wordpress » How to Limit the size of the post excerpt in WordPress

Here is code to Limit the size of the post excerpt in WordPress.
Add below code into function.php it will set limit 20 charactor.

function custom_excerpt_length( $length ) {
	return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

Array ( [0] => Wordpress )