Change excerpt length in wordpress

By default wordpress excerpt words length is 55 words. If you want to limit wordpress excerpt word length from 55 words to something else then add this below code in your theme Functions.php file.

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

Change the number 20 to something as your needs.

Leave a Reply

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

Solve : *
26 × 21 =