Override / filter Excerpt 55 chars length default

⚠️ Code snippets might not be compatible with the latest version of your theme. Always use a child theme to customize your theme, and test your code on a staging website before migrating to production.

WordPress sets a default limit of 55 characters for Excerpts.

You can override this limit by adding this code to your functions.php file in a child theme

Where to copy/paste this code?
We strongly recommend you create a child theme and add this to the Child Theme functions.php.
Download a start-up child theme here.

Remember: you shouldn’t edit the theme’s functions.php.

//Change WordPress Excerpt length
function your_excerpt_length( $length ) {
return 200;
}
add_filter( 'excerpt_length', 'your_excerpt_length' );

Change the 200 to whatever you need.

Leave a comment

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

6 thoughts on “Override / filter Excerpt 55 chars length default”