This page redirects to an external site: https://developer.wordpress.org/reference/hooks/excerpt_length/
This filter is used by wp_trim_excerpt() function. By default the excerpt length is set to return 55 words.
To change excerpt length, add the following code to functions.php file in your theme adjusting the "20" to match the number of words you wish to display in the excerpt:
function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
Make sure to set the priority correctly, such as 999, else the default WordPress filter on this function will run last and override what you set here.
wp_trim_excerpt() is located in wp-includes/formatting.php.