Codex

Plugin API/Filter Reference/excerpt length

Contents

Description

This filter is used by wp_trim_excerpt() function. By default the excerpt length is set to return 55 words.

Examples

To change excerpt length, add the following code to functions.php file in your theme:

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

Change Log

Source File

wp_trim_excerpt() is located in wp-includes/formatting.php.

Related

This page is marked as incomplete. You can help Codex by expanding it.