[ALL THEME] Custom Excerpt in WordPress

Excerpts are the short extract from your post. WordPress comes with a built-in function which makes it easier for you to decide what you want to show as the excerpt for your post.

If you do not write a custom excerpt, then WordPress automatically takes the first 55 words from your post and put them in an excerpt and display it. Sometimes it may not look good, that’s why you may want to create a custom excerpt.

Adding a custom excerpt in WordPress is quite simple. Create a new post or edit an existing one.

  • On the post edit screen, click on the Screen Options tab on the top right and then select Excerpt.

  • This will display an Excerpt meta box below your post editor. You can now add any text in this box, and it will be used as the excerpt for the post.

  • Finally, you will get the Custom Excerpt in the Archive layouts as below

NOTE: You can change the default Excerpt length starting from WordPress 2.9. Please open your functions.php file and add the following function:

// Changing excerpt length
function new_excerpt_length($length) {
 return 100; 
} 
add_filter('excerpt_length', 'new_excerpt_length');

In the example above, “100” is the excerpt limit, but you can change that value to your desired length.