the get_excerpt function on WordPress shows the first 55 words of your post, striped out of any special formatting eg: links, bold, etc.  I wanted to change it for a blog I was developing so I traced it back to the function wp_trim_excerpt in the file \wp-includes\formatting.php. In this file you can change the value from 55 to , in my case 100. Just change the line 786 which should look like this  $excerpt_length = 55;

Please remember that this will change the default value for all you excerpts.

UPDATED:  See Mike Schinkel’s comment for updated information (Thank you)

4 Replies to “WordPress get_excerpt – show more words”

  1. Hello!
    Very Interesting post! Thank you for such interesting resource!
    PS: Sorry for my bad english, I’v just started to learn this language 😉
    See you!
    Your, Raiul Baztepo

  2. Hi Alex,

    Conceptually, this is a great idea. In practice, you are suggesting that someone modify WordPress’ core code which isa really bad idea. Instead, they should use a filter “hook.” They can add this to their theme’s functions.php file to do the same:

    add_filter(‘excerpt_length’,’set_my_excerpt_length’);
    function set_my_excerpt_length($length) {
    return 100;
    }

    This works for WordPress v2.7 and later, see:
    http://adambrown.info/p/wp_hooks/hook/excerpt_length?version=2.7&file=wp-includes/formatting.php

    HTH.

    -Mike

  3. Hi Mike

    Thank you for the comment and improvement on the content of this post. I have added a link to your comment in the main post body.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.