How to change WordPress excerpt length

By default WordPress excerpts are 55 characters long. If you want to make you excerpts longer or shorter, you can do this by adding this code snippet to your themes functions.php:

add_filter('excerpt_length', 'tk_excerpt_length');

function tk_excerpt_length($length){
  return 40;
}

 

Leave a Comment

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