Causes the excerpt to be required before a post can be published. Supports the classic editor and the block editor (“Gutenberg”). It’s available in the WordPress plugin repository.
An excerpt is a (usually) brief, text-only post summary. It is used in various places by a theme when a summary of a post is needed, such as on your blog page or on the archive pages for terms.
Excerpts are either manually crafted or (usually poorly) automatically extracted from the main post content. Hand crafted ones are better because
- they avoid things like sentences being cut off in the mid…
- they allow you create an actual summary and not just the first x words from the post content
- they allow you to do better SEO targeting
- they look better
This plugin will enforce the use of hand-crafted excerpts by your users by preventing a post without an excerpt from being published.
Tip: If you don’t see a spot for the excerpt in your Classic Editor post edit screen, there are two possible reasons for this.
- The post type does not support the excerpt field. Generally, posts and pages support it but it can be turned off in code. Additionally, if you’re using a custom post type and support for excerpt is not there, you’ll need to get it added.
- The excerpt field is not being displayed. To see it, click on Screen Options button on the top right corner of the classic editor post edit screen and then enable it.
The plugin is available in the WordPress plugin repository. If you’re installing from within your site, search for “Mandatory Excerpt” in your plugins panel, and install it when it comes up. If you’re after more detailed instructions, here you go!
Install and it’s ready to go. By default it works with posts and pages, but you can add custom post type support using the available filters.
What it Does
The classic editor is the original post editor for WordPress, and the block editor (also known as “Gutenberg”) is the newer editor. Both are supported but work in different ways.
If you are trying to publish an unpublished post and the excerpt is not set, here is what happens
- When you click publish, we check to see if this post type must have an excerpt.
- If #1 is true, then we check to see if the excerpt is written.
- If #2 is not true, all of the following happen
- the publication of the post is cancelled
- the post status is set to draft
- a warning message appears at the top of the screen that looks like this
The same things happen if you try to update an already published post that has no excerpt.
Gutenberg/ Block Editor
When you try to publish a post that has no excerpt set, you’ll see that the Publish button is disabled. You also get a message about the missing excerpt.
The Publish button is re-enabled when the excerpt has some content.