How to change excerpt length in WordPress

By default, WordPress displays the first 55 words from the post content for the excerpt. But sometimes we need to show more or fewer words. This tutorial shows you how to change the default excerpt length of your theme.

Simply open your functions.php and put this PHP code-

This function where it specifies ‘return 15’ is to change the excerpt length to 15 words. You may change the ‘return’ value to any number as you like.

Leave a Reply

Close Menu