WP Trick: Increase Length of Excerpt

Today, I learned a new little trick: how to increase the length of a excerpt.

By default, WordPress sets article excerpts at 55 characters and for most websites, that’s probably fine. (Heck, it took me this long to bother learning this.) However, for some sites, you may want to make that limit shorter or longer, depending on how it looks on the page.

Here is how to modify that limit.

In your functions.php file, add this bit of code at the bottom, right above the last ?>.

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

This bit of code tells WordPress to set the length of excerpts to 80 characters. That’s it!