Home / Archive / Change Excerpt Length
Duplicate Snippet

Embed Snippet on Your Site

Change Excerpt Length

Update the length of the Excerpts on your website using this snippet.
WPCode Team
200+
Code Preview
php
<?php
add_filter(
	'excerpt_length',
	function ( $length ) {
		// Number of words to display in the excerpt.
		return 40;
	},
	500
);

Comments

Add a Comment