⏲️ Estimated reading time: 5 min
Posts Missing Excerpt Dashboard Widget
How to Add It in WordPress. This tutorial shows you how to add a custom WordPress dashboard widget that lists all posts missing excerpts, helping you improve SEO and content quality directly from your admin panel. Includes full PHP code and setup guide.
When managing a blog with dozens or hundreds of posts, it’s easy to forget to add excerpts. Missing excerpts can negatively affect your SEO and click-through rates in search engines.
To make this process easier, you can add a WordPress dashboard widget that instantly shows you which posts have no excerpt and even lets you edit them directly.
In this tutorial, you’ll learn how to:
- Count all posts without excerpts.
- Display them in the WordPress dashboard.
- Quickly access the edit page to fix them.
Why Are Missing Excerpts Important?
An excerpt is a short summary of your post, used in:
- Search results snippets.
- Social media previews.
- Your theme’s post listing pages.
Without an excerpt, WordPress will try to auto-generate one by taking the first few words of your content but this is often less engaging and bad for SEO. Writing a custom excerpt gives you full control over what users see before clicking.

The PHP Code
Below is the complete code for adding the widget.
You can place it inside your functions.php file or in a custom plugin.
<?php
/**
* Dashboard Widget: Posts Without Excerpt (WP_Query version) Title turns red if missing excerpts
*/
add_action('wp_dashboard_setup', 'hz_dashboard_posts_no_excerpt');
function hz_dashboard_posts_no_excerpt() {
global $wpdb;
// Numărăm postările fără excerpt
$count = (int) $wpdb->get_var("
SELECT COUNT(*)
FROM {$wpdb->posts}
WHERE post_type = 'post'
AND post_status = 'publish'
AND post_excerpt = ''
");
$title = 'Posts Without Excerpt';
if ($count > 0) {
$title .= ' (' . $count . ')';
}
wp_add_dashboard_widget(
'hz_posts_no_excerpt_widget', // Widget ID
$title, // Widget Title
'hz_posts_no_excerpt_display' // Callback function
);
// Dacă lipsesc excerpt-uri, colorează titlul în roșu
if ($count > 0) {
add_action('admin_head-index.php', function () {
echo '<style>#hz_posts_no_excerpt_widget .hndle{color:#d32f2f !important;}</style>';
});
}
}
function hz_posts_no_excerpt_display() {
global $wpdb;
// Query all posts with empty excerpt
$posts = $wpdb->get_results("
SELECT ID, post_title
FROM {$wpdb->posts}
WHERE post_type = 'post'
AND post_status = 'publish'
AND post_excerpt = ''
ORDER BY post_date DESC
");
if (empty($posts)) {
echo '<p>✅ All posts have excerpts!</p>';
} else {
echo '<p>The following posts have no excerpt:</p>';
echo '<ul style="list-style: disc; margin-left: 20px;">';
foreach ($posts as $post) {
$edit_link = get_edit_post_link($post->ID);
echo '<li><a href="' . esc_url($edit_link) . '">' . esc_html($post->post_title ?: '(no title)') . '</a></li>';
}
echo '</ul>';
}
// Footer note with HelpZone link
echo '<p style="margin-top:15px; font-size:13px; color:#555;">
🛠️ Visit <a href="https://helpzone.blog" target="_blank">HelpZone</a> for more WP tools.
</p>';
}
How This Works
wp_dashboard_setup
Hook
This hook allows you to register a custom dashboard widget.- Counting Posts Without Excerpts
Using$wpdb->get_var()
we query the database to find all posts where thepost_excerpt
field is empty. - Dynamic Widget Title
If there are posts missing excerpts, the widget title will show the number in parentheses. - Listing the Posts
The second query fetches all posts with missing excerpts, ordered by their publication date. Each post title links to its edit page, so you can fix it quickly. - Empty State Message
If all posts have excerpts, it shows a friendly “✅ All posts have excerpts!” message.
How to Add This to Your Site
You have two main options:
Option 1: Add to functions.php
- Go to Appearance → Theme File Editor.
- Open the
functions.php
file of your child theme. - Paste the code at the bottom.
- Save the changes.
Option 2: Create a Simple Plugin
- Create a new folder in
/wp-content/plugins/
namedposts-no-excerpt-widget
. - Inside, create a file called
posts-no-excerpt-widget.php
. - Add this header at the top of the file:
<?php /* Plugin Name: Posts Without Excerpt Widget Description: Displays a dashboard widget listing all posts without excerpts. Version: 1.0 Author: Your Name */
- Paste the full code below it.
- Activate the plugin in Plugins → Installed Plugins.
Advantages of Using This Widget
- Instant Overview: No need to manually check each post.
- SEO Boost: Helps ensure all posts have optimized summaries.
- Time-Saving: Edit directly from the dashboard list.
- Better User Experience: Excerpts improve how posts appear in archives and previews.
Possible Improvements
You could expand this widget to:
- Filter by category – see missing excerpts per topic.
- Bulk edit support – add excerpts without opening each post.
- Highlight posts older than X days with no excerpt.
Final Thoughts
If you want to maintain a high-quality blog, this Posts Without Excerpt dashboard widget is a small but powerful addition.
It ensures you never forget to optimize your posts for search engines and readers, keeping your content professional and engaging.
🔔 For more tutorials like this, consider subscribing to our blog.
📩 Do you have questions or suggestions? Leave a comment or contact us!
🏷️ Tags: wordpress dashboard widget, missing excerpt checker, wordpress seo tips, wordpress admin customization, wp dashboard tools, content optimization, wordpress plugin tutorial, wordpress functions php, seo content writing, wordpress tips and tricks
📢 Hashtags: #WordPress #SEO #DashboardWidget #ContentOptimization #WebDevelopment #WPAdmin #BloggingTips #PHP #WordPressPlugins #WebsiteManagement
Only logged-in users can submit reports.
Discover more from HelpZone
Subscribe to get the latest posts sent to your email.