BIOS,Windows, Linux, Software,Security, Domains, Web Hosting

Change Default Excerpt Length in WordPress

If you are using wordpress for your website, you may find wordpress output all the post content in your homepage, this is truly annoying. We know there are several method to customize it.

How to Customize WordPress Excerpts

But If you decide to use the_excerpt function, you may need to change the default excerpt length. because the default length is only 55 words.

1. Change the_content to the_excerpt

Normally, the homepage will output all post content, you must change the_content to the_excerpt, or you will see nothing changed in your homepage even if you have added codes in your functions.php according the next statement.

but how to make your homepage output excerpt? locate to yourtheme directory, usually there is a file named "content.php"


Find the php codes between "<div class="entry-content">" and "</div>"


<?php the_content(); ?>


<?php the_excerpt(); ?>

2. Add excerpt filter

Here I want to change it to "250", Please add these codes in your /wp-content/themes/yourtheme/functions.php:

function my_excerpt_length($length) {
return 250;//change to your length.
add_filter('excerpt_length', 'my_excerpt_length');

OK, refresh your pages in your browser.


Leave a Reply

Subscribe to BootBeta Comments RSS feed to receive notification of latest comments posted.


  • Enter Email Address:

Recent Post

Copyright@ 2010-2014 Bootbeta All Rights Reserved.
HooBlog Ver 1.5 Build 20140530