WordPress is a great open source bogging and content publishing tool. It offers a lot flexibility and ease when it comes to customize its default features and functionality.
By default, WordPress shows an excerpt or summary of posts in the archive or feeds up-to 55 words. We can change the length of summary or excerpt using ‘excerpt_length’ filter. See below code for changing excerpt length in WordPress.
function oc_custom_excerpt_length( $length ) {
return 20; // Length up to 20 words.
}
add_filter( 'excerpt_length', 'oc_custom_excerpt_length', 999 );
Above code will change the excerpt or summary length to 20 words.