Adding notification bubbles to WordPress Custom Post Types (CPTs) is an effective way to provide at-a-glance insights within the WordPress admin area. These bubbles—also known as admin badges—typically appear in the left sidebar navigation and indicate the number of new or pending items. For site managers and content editors, they offer a streamlined method for tracking content workflow and updates.
While WordPress automatically includes notification bubbles for native post types such as Posts and Comments, custom post types require a bit of extra configuration. In this article, we’ll explore the benefits, technical requirements, and steps to implement this feature in a secure and scalable manner.
Why Add Notification Bubbles to Custom Post Types?
1. Improved User Experience: Admin notification bubbles enhance visibility. Editors can quickly identify how many pending reviews, drafts, or submissions exist without opening each section.
2. Workflow Efficiency: For websites with content-heavy workflows—such as magazines, classifieds, or community platforms—real-time indicators of action items help streamline editorial processes.
3. Professionalism: A customized admin interface with clear, consistent UI cues demonstrates attention to detail and improves client trust when building custom solutions.

Key Prerequisites
Before proceeding, ensure that you have:
- A custom post type registered using register_post_type().
- Access to your theme or plugin’s functions.php file or a custom plugin for inserting admin-specific logic.
- Basic familiarity with WordPress hooks and conditional statements.
Step-By-Step: Add Notification Bubbles
The following steps walk you through adding a bubble for a CPT called portfolio. You can modify the code for your specific needs.
1. Count the Posts
We’ll need to count how many unpublished or pending posts exist. You can use wp_count_posts() for this purpose.
function get_portfolio_pending_count() {
$counts = wp_count_posts('portfolio');
return isset($counts->pending) ? $counts->pending : 0;
}
2. Modify the Admin Menu
Next, we’ll hook into admin_menu to inject the count as an HTML bubble alongside the CPT label.
function show_portfolio_admin_bubble() {
global $menu;
$pending_count = get_portfolio_pending_count();
foreach ($menu as $key => $value) {
if ($value[2] == 'edit.php?post_type=portfolio') {
if ($pending_count > 0) {
$menu[$key][0] .= ' ' . $pending_count . '';
}
}
}
}
add_action('admin_menu', 'show_portfolio_admin_bubble');
This action ensures the notification bubble only appears if there are pending items. You can customize the logic to reflect drafts, private posts, or other statuses based on your use case.
3. Style Consistently
WordPress already includes styles for notification badges through its core CSS. The class update-plugins
ensures consistency with existing admin interface elements.
If using a custom admin theme or branding, you can override this styling to match your palette. However, it’s recommended to retain the structure to maintain UX consistency.

Best Practices for Implementation
- Avoid Hardcoding: Use dynamic variables and functions instead of hardcoded post type names to promote reusability.
- Permission Checks: Add checks to ensure that only users with appropriate permissions (e.g., editors or admins) can see and act on the post type items.
- Performance Consideration: Avoid querying posts on every page load—use wp_count_posts() which pulls from cached data.
Conclusion
Adding notification bubbles to your custom post types is a minor tweak that pays major dividends in terms of usability and efficiency. It helps team members stay informed and contributes to a polished, professional admin interface.
Whether you’re developing themes for clients or managing your own editorial website, this enhancement allows you to bring more clarity and responsiveness to your daily content workflows. By following the PHP and hook-based method described above, you’ll integrate seamlessly with the WordPress core experience while tailoring it to your custom functionality.