WP-Mix

A fresh mix of code snippets and tutorials

WordPress Change Excerpt Length

This code snippet is SO easy.. check it out if you want to change the default number of words included by default in WordPress excerpts.

To customize the WordPress excerpt length, add the following code to functions.php:

function custom_excerpt_length($length) {
	return 20;
}
add_filter('excerpt_length', 'custom_excerpt_length', 999);

Nothing else to do except to change the 20 to whatever number of words you would like to include in all excerpts. Easy peasy!

Reference

Learn more

Digging Into WordPressWordPress Themes In DepthWizard’s SQL Recipes for WordPress