sandywp / plugins / advanced-excerpt
Advanced Excerpt
Control the appearance of WordPress post excerpts
Ready in seconds.
v4.5 80,000+ installs WP 3.2+ PHP 7.4+

What you get inside
2 screens-
The options page
-
An example of an excerpt generated by the plugin
About this plugin
This plugin adds several improvements to WordPress’ default way of creating excerpts.
- Keeps HTML markup in the excerpt (and you get to choose which tags are included)
- Trims the excerpt to a given length using either character count or word count
- Only the ‘real’ text is counted (HTML is ignored but kept)
- Customizes the excerpt length and the ellipsis character that are used
- Completes the last word or sentence in an excerpt (no weird cuts)
- Adds a read-more link to the text
- Ignores custom excerpts and use the generated one instead
- Theme developers can use
the_advanced_excerpt()for even more control (see the FAQ)
Most of the above features are optional and/or can be customized by the user or theme developer.
Banner image credit – chillihead
Original plugin author – basvd
Useful Resources
Questions
- What’s an excerpt?
A short version of a post that is usually displayed wherever the whole post would be too much (eg. search results, news feeds, archives). You can write them yourself, but if you don’t, WordPress will make a very basic one instead.
- Why do I need this plugin?
The default excerpt created by WordPress removes all HTML. If your theme uses
the_excerpt()orthe_content()to view excerpts, they might look weird because of this (smilies are removed, lists are flattened, etc.) This plugin fixes that and also gives you more control over excerpts.- Does it work for WordPress version x.x.x?
During development, the plugin is tested with the most recent version(s) of WordPress. It might work on older versions, but it’s better to just keep your installation up-to-date.
- Is this plugin available in my language?
Advanced Excerpt is internationalization (i18n) friendly.
- Does this plugin support multibyte characters, such as Chinese?
Before 4.1, multibyte characters were supported directly by this plugin. This feature has been removed because it added irrelevant code for a ‘problem’ that isn’t actually specific to the plugin.
If you require multibyte character support on your website, you can override the default text operations in PHP.
- Can I manually call the filter in my WP theme or plugin?
The plugin automatically hooks on
the_excerpt()andthe_content()functions and uses the parameters specified in the options panel.If you want to call the filter with different options, you can use
the_advanced_excerpt()template tag provided by this plugin. This tag accepts query-string-style parameters (theme developers will be familiar with this notation).The following parameters can be set:
length, an integer that determines the length of the excerptlength_type, enumeration, if set towordsthe excerpt length will be in words; if set tocharactersthe excerpt length will be in charactersno_custom, if set to1, an excerpt will be generated even if the post has a custom excerpt; if set to0, the custom excerpt will be usedno_shortcode, if set to1, shortcodes are removed from the excerpt; if set to0, shortcodes will be parsedfinish, enumeration, if set toexactthe excerpt will be the exact lenth as defined by the “Excerpt Length” option. If set towordthe last word in the excerpt will be completed. If set tosentencethe last sentence in the excerpt will be completed.ellipsis, the string that will substitute the omitted part of the post; if you want to use HTML entities in the string, use%26instead of the&prefix to avoid breaking the queryread_more, the text used in the read-more linkadd_link, if set to1, the read-more link will be appended; if0, no link will be addedallowed_tags, a comma-separated list of HTML tags that are allowed in the excerpt. Entering_allwill preserve all tags.exclude_tags, a comma-separated list of HTML tags that must be removed from the excerpt. Using this setting in combination withallowed_tagsmakes no sense
A custom advanced excerpt call could look like this:
the_advanced_excerpt('length=320&length_type=words&no_custom=1&ellipsis=%26hellip;&exclude_tags=img,p,strong');- Does this plugin work outside the Loop?
No, this plugin fetches the post from The Loop and there is currently no way to pass a post ID or any custom input to it.
However, you can start The Loop manually and apply the plugin as usual.
sandywp / also on the shelf
Try another plugin
4.3 · 1M+ installs
Import your demo content, widgets and theme settings with one click. Theme authors! Enable simple theme demo import for your…
2.7 · 20K+ installs
Make your website look like the live demo of the theme with a click!
Soro – SEO Autopilot & AI Content Writer
5.0 · 10K+ installs
Connect your WordPress site to Soro for automatic AI-powered article publishing and SEO content automation.
Spin up a real WordPress site in seconds.
Test plugins, build a demo, hand a client a link — then squash it and start again. No local setup, no Docker.