WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Advanced Excerpt

Control the appearance of WordPress post excerpts

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() or the_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? / How do I translate this plugin?

Advanced Excerpt is internationalization (i18n) friendly. If you'd like to contribute a translation for your language please do so by opening a pull request.

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() and the_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 excerpt
  • length_type, enumeration, if set to words the excerpt length will be in words; if set to characters the excerpt length will be in characters
  • no_custom, if set to 1, an excerpt will be generated even if the post has a custom excerpt; if set to 0, the custom excerpt will be used
  • no_shortcode, if set to 1, shortcodes are removed from the excerpt; if set to 0, shortcodes will be parsed
  • finish, enumeration, if set to exact the excerpt will be the exact lenth as defined by the "Excerpt Length" option. If set to word the last word in the excerpt will be completed. If set to sentence the 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 %26 instead of the & prefix to avoid breaking the query
  • read_more, the text used in the read-more link
  • add_link, if set to 1, the read-more link will be appended; if 0, no link will be added
  • allowed_tags, a comma-separated list of HTML tags that are allowed in the excerpt. Entering _all will preserve all tags.
  • exclude_tags, a comma-separated list of HTML tags that must be removed from the excerpt. Using this setting in combination with allowed_tags makes 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.

Requires: 3.2 or higher
Compatible up to: 3.9.2
Last Updated: 2014-6-10
Downloads: 301,693

Ratings

4 stars
4.2 out of 5 stars

Support

6 of 17 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

1 person says it works.
1 person says it's broken.

100,3,3 100,1,1
100,3,3 0,1,0
0,1,0
100,2,2 100,1,1 83,6,5
75,16,12
86,7,6
93,15,14
50,2,1
25,4,1
63,8,5
100,1,1
40,10,4
50,4,2
100,4,4
100,5,5
0,1,0
50,2,1 100,1,1
80,10,8 50,4,2 100,1,1 100,1,1
0,4,0 20,5,1 44,9,4
74,19,14
100,3,3
100,3,3
44,9,4
45,11,5
50,6,3
27,11,3
50,2,1
80,5,4
75,4,3
50,2,1
100,1,1 0,3,0 0,3,0 100,1,1 100,2,2
50,2,1