Given a category (not the category group), is there a way to get the count entries assigned to that category? I'm hoping for a native EE solution. This seems to suggest that there isn't one: Anyone know of a plugin to show Category count?. Can I do this in EE only?

  • If you have received the answer to your question please choose your desired answer. Commented Jul 6, 2014 at 2:26

2 Answers 2


Here is a plugin that will give you the desired result you need without a custom query.



I think the simplest and quickest solution if no one wrote a plug-in already would be:

{exp:query sql="SELECT COUNT(entry_id) AS cat_count FROM exp_category_posts WHERE cat_id=1"}{cat_count}{/exp:query}

Note: Untested.

Obviously replace the cat_id value with the category ID you want to count entries for. :)

If you don't have the category ID in the URL, but have its category_url_title:

SELECT COUNT(entry_id) AS cat_count
FROM exp_category_posts AS cp
JOIN exp_categories AS c ON cp.cat_id = c.cat_id
WHERE c.cat_url_title = "{segment_X}"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.