By default, WordPress displays only 55 words as an excerpt but sometimes we need to change the post excerpt words length, while we customizing the archive landing page or post-landing page from default to the new word limit.
In this tutorial, I will explain how to change post excerpt length in WordPress by applying some code in your functions.php file from your current activated WordPress theme folder.
You can change the default WordPress post excerpt from 55 words to as you want by following the below two mehtods:
Open functions.php file from your current activated theme folder and copy paste below code at the end of the file. Below code will change the post excerpt from 55 words to 150 words.
1 2 3 4 5 | /* Changed excerpt length to 150 words*/ function my_excerpt_length($length) { return 150; } add_filter('excerpt_length', 'my_excerpt_length'); |
If you have not coding knowledge OR you don’t want to make any changes in your theme’s files, then this method will help you to change the post excerpt from default 55 words to as you want. follow the below steps to install and configure this plugin.
Step 1) Download the latest version of Advanced Excerpt plugin from WordPress.org.
Step 2) Login to your website admin panel and navigate to the Plugins => Add New and then click on the upload button.
Step 3) Select the downloaded zip file from your computer and click on install now button.
Step 4) Click on Activate button after the installation and follow the plugin’s instructions.
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: change post excerpt, excerpt in wordpress, post excerpt, wordpress excerpt, wordpress excerpt plugin, wordpress post excerpt