How to Change The Default Excerpt Length In WordPress

Most of the themes in WordPress show excerpts on archive pages like category and tags. By default, the excerpt length is 55 words in WordPress. 

We can change this default length using WordPress built-in filter named ‘excerpt_length’. This will allow you to change the default length of excerpts for all loops.

Simply copy and paste the following code to your functions.php file.

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

The above code will change the default excerpt length to 20 words. You can change ‘20’ to any number as per your theme design requirements.

Leave a Reply

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