The WordPress theme and software itself automate the creation of a large portion of your site’s content, which is one of the key draws.
The excerpt feature, for example, displays the first “55” words of your article on the homepage, archive pages (category and tags), and search results pages.
But what if you needed to share a smaller or larger snippet than the standard 55 words?
When amending a post, you have the option of either using the “more” function to select a specific place for the excerpt or using the excerpt box to paste a custom excerpt.
To avoid any duplicate content concerns and keep in good standing with search engines like Google, I recommend using the custom excerpt option, which allows you to not only specify a custom excerpt but also make it 100% unique.
However, you will likely want to utilize some code or a plugin if you currently have hundreds or thousands of articles published, and you want to rapidly modify the excerpt length, so all your post entries are consistent.
Modifying the Extract Length of All Recurring Elements
The default length of your excerpts may be modified in your theme, and thankfully WordPress has a built-in filter suitably titled “excerpt length” to do just that.
To change the number of words shown in excerpts, copy and paste the following code into your functions.php file, replacing the “20” with the desired number of words.
Alternatively, you may check out the free plugin Advanced Excerpt, which will let you easily modify not just the excerpt length but also the read more link, the stripping out of shortcodes, the allowance of html, and so on.
Both of those approaches presume, of course, that your theme is already set up to make use of the excerpt function.
Extraction features often come pre-built into themes (particularly paid ones), giving you more leeway. If the preceding code does not work for you, contact the theme’s author and inquire as to how to modify the excerpt lengths.
Cut-to-Fit Paragraphs (for Developers)
If you’re a developer seeking to add configurable excerpts to your theme or plugin, we’ve put up a guide with a handy custom function you can copy and paste into your project to show off variable excerpt lengths throughout the site for various archives, post kinds, etc.
- WordPress Security Tips for Beginners: [5 Best Ways To Keep Safe]
- Top 10 Best Blogging WordPress Themes
- How To Quickly Delete All WordPress Comments With One Click?
Conclusion: How to Change the Default Excerpt Length in WordPress?
Above we mentioned an overview of this topic. If still, you have any queries, suggestions or advice then do let us know in the comment section below.