Change the default excerpt length on WordPress posts

How to change the default excerpt length on WordPress posts within your theme functions.php file.

function my_excerpt_length( $length ) {
    return 33;
}
add_filter( 'excerpt_length', 'my_excerpt_length', 999 );
Published
Categorized as WordPress