---
title: Filter the admin bar counter
url: "https://www.seopress.org/support/hooks/filter-the-admin-bar-counter/"
lang: en-US
updated: 2025-04-09
hook_name: seopress_adminbar_counter
required_version: 8.7
---

# Filter the admin bar counter

- **Hook name:** `seopress_adminbar_counter`
- **Required version:** 8.7

```php
function sp_adminbar_counter($counter, $total) {
	// Default counter
	$counter = '<div class="wp-core-ui wp-ui-notification seopress-menu-notification-counter">' . $total . '</div>';

	return $counter;
}
add_filter('seopress_adminbar_counter', 'sp_adminbar_counter', 10, 2);
```

Source: [https://gist.github.com/wp-seopress/3bf2d088ddbc7a818797df837b625a15](https://gist.github.com/wp-seopress/3bf2d088ddbc7a818797df837b625a15)



