Change excerpt length in WP by eckert


The default excerpt length in WordPress is 55 words.

If you want to change it, go into “wp-includes”, “formatting.php” and scroll down to line 1812 (in versions prior to 2.7, it was line 853).  If you are unable to find it, just do a find on the page for “55″ and you should come across it.

Change the “55″ to however many words you’d like it to be.

Tags: , , ,

10 Responses to “Change excerpt length in WP”

  1. Lloyd Armbrust Says:

    Oh my goodness. I’ve been looking for that forever. How did you find that?

  2. Anne Says:

    Thank you, this saved me so much time! Much appreciated

  3. Lee Kelleher Says:

    I created a plugin for the WordPress backend to make it easier to change the length of the excerpt – without having to edit any core WordPress files.

    http://wordpress.org/extend/plugins/excerpt-length/

    The downside is that it only works in WordPress 2.7 and above.

  4. seth Says:

    thanks a lot, just solved a problem for a client :)

  5. berdetik Says:

    it is so simple and works!

    many tutorials on google like the following links doesn’t work.

    http://www.google.com/search?aq=f&sourceid=chrome&ie=UTF-8&q=change+wordpress+lenght+default+excerpt

    many thanks mister.

  6. cam bam Says:

    Or… you could just use filters :)

    http://codex.wordpress.org/Template_Tags/the_excerpt

  7. Ben Says:

    I did a quick write up here for changing the WP Excerpt – How to change the_excerpt() in WordPress.

  8. wartabumi Says:

    You have solved my problem … thanks

  9. Erik Landvall Says:

    u can add theas lines in youre function.php file:

    function hsbo_excerpt_length( $length )
    {
    return 60;
    }
    add_filter(‘excerpt_length’, ‘hsbo_excerpt_length’);

    I used hsbo as the namespace, u can ofc use what ever u like

  10. Andreas Says:

    THANK YOU SO VERY MUCH… omg, that was a strugle! ty!!

Leave a Reply


It’s Called Web Design is sponsored by Seeing Interactive and powered by WordPress
Entries (RSS) and Comments (RSS).
54 queries. 0.297 seconds.