Count Posts in a Category, Tag, or Custom Taxonomy
Adds a custom shortcode that returns the number of posts in a category, tag, or custom taxonomy. Accepts a slug (default), ID, or name as input and wo …
Next Milestone 300
Unlock Exact Install Count
See the precise estimated active installs for this plugin, calculated from real-time ranking data.
- Exact install estimates within tiers
- Track install growth over time
- Milestone progress predictions
Rank Changes
Downloads Growth
Upgrade to Pro
Unlock 30-day, 90-day, and yearly download history charts with a Pro subscription.
Upgrade NowReviews & Ratings
Tracked Keywords
Showing 0 of 0| Keyword | Position | Change | Type | Updated |
|---|---|---|---|---|
| No keyword data available yet. | ||||
Unlock Keyword Analytics
Track keyword rankings, search positions, and discover new ranking opportunities with a Pro subscription.
- Full keyword position tracking
- Historical ranking data
- Competitor keyword analysis
Track This Plugin
Get detailed analytics, keyword tracking, and position alerts delivered to your inbox.
Start Tracking FreePlugin Details
- Version
- 3.1
- Last Updated
- Jan 01, 2013
- Requires WP
- 2.8+
- Tested Up To
- 3.5
- PHP Version
- N/A
- Author
- bitacre
Support & Rating
- Rating
- ★ ★ ★ ★ ★ 5
- Reviews
- 2
- Support Threads
- 0
- Resolved
- 0%
Keywords
Upgrade to Pro
Unlock keyword rankings, search positions, and detailed analytics with a Pro subscription.
Upgrade NowSimilar Plugins
Frequently Asked Questions
Common questions about Count Posts in a Category, Tag, or Custom Taxonomy
* [cat_count slug="category-slug"]
or for a tag:
* [tag_count slug="tag-slug"]
or for a custom taxonomy:
* [tax_count tax="taxonomy-name" slug="taxonomy-slug"]
The legacy shortcode assumes you are giving it slugs, but it can also accept category names or IDs:
[ccp type="name" cat="Category Name"]
[ccp type="id" cat="27"]
or for a tag:
* [ccp type="name" tag="Tag Name"]
* [ccp type="id" tag="28"]
So, for example, if you had 3 categories with the slugs "cat-1", "cat-2", and "cat-3" each with 10 posts, you could get the count for all three (it would return "30") using this shortcode:
[cat_count slug="cat-1,cat-2,cat-3"]
Thanks to Jack Brand for this excellent suggestion.
It keeps returning 0 posts, why?
Make sure you're using the correct slug, sometimes they are different from the actual category name and capitalization matters. You can view them by clicking on the Categories link under Posts.
Also don't literally copy "category-slug," you need to put the category you want counted there, that's just a place holder. So to count the number of posts in a category called 'Book Reviews' with a slug name of 'book-reviews' you would insert [cat_count slug="book-reviews"].
Why are there 2 kinds of shortcodes
The shortcodes without underscores are legacy shortcodes, I left them in the plugin so stuff won't break, but you should use the new shortcodes if possible. The legacy shortcodes include:
[ccp]
[catcountposts]
[countposts]
[countpost]
[postsincat]
[postincat]
The legacy shortcodes only work for categories and tags, and they all follow the format [ccp type="slug/id/name" cat="category-slug/id/name" tag="tag-slug/id/name"]
The NEW shortcodes all have underscores, and follow a slightly different format. There are 3 seperate shortcodes:
For Categories:
* [cat_count slug="cat-slug"] or [cat_count id="45"] or [cat_count name="Category Name"]
For Tags:
* [tag_count {slug="tag-slug"} {id="45"} {name="tag name"} ]
For Custom Taxonomies:
* [tax_count tax="custom-tax-type" {slug="tax-slug"} {id="99"} {name="Taxonomy Item Name"} ]
You only need to specify 1 of the following: slug="", id="", or name="". If you specify more than one, the plugin will ignore the other attributes in the order of slug > id > name.
You also need to specify the tax="custom-tax-type" for the [tax_count] shortcode. This is so the plugin knows which custom taxonomy to count.
Can you add this feature I just thought of?
Can I? Yes. Will I? Yes, if I think it would be a helpful addition. I'm trying to keep things clean and simple, but there's always room for improvement, so let me know if you think a feature is lacking!