Change the excerpt length in WordPress

Change the excerpt length: There are many cases where a blog author might want to increase or decrease the length of WordPress post excerpts "the_excerpt()". Excerpts are basically condensed descriptions of your blog posts and are commonly used to provide introductory "teaser" information about the post. In the following simple solution, I'll show you how to lengthen or shorten the excerpt in WordPress to suite your personal blogging needs.

How to Change the WordPress post excerpt length:

  1. Login to your WordPress Site and perform the following steps:
    1. Navigate to Appearance section in the Sidebar and Click Editor
    2. Click the Theme Functions or "functions.php" template file
    3. Just above the closing <?php } ?> tag add the following code:

      add_filter('excerpt_length', 'my_excerpt_length');
      function my_excerpt_length($length) {
      return 20; }

  2. Change 20 to the length you would like the WordPress excerpt to be
  3. Update the file and and go view your site

(Click the Screenshot for a visual of these steps)

Changing the WordPress Excerpt Length

That's all there is to it. Now when you visit a section on your site containing a post excerpt, the length of the excerpt will reflect the number of characters you have set to display as an excerpt.

Enjoy! ;)