# WooCommerce Product Count Shortcode — free WordPress plugin

> Show your total WooCommerce product count anywhere with one shortcode. Filter by category, and leave out hidden products if you like.

Source: https://dcarock.com/plugins/woocommerce-product-count-shortcode

- Type: free WordPress plugin
- Price: free (GPL-2.0)
- Version: 1.1
- Requires: WordPress 6.0+, PHP 7.4+
- Download: https://dcarock.com/plugins/woocommerce-product-count-shortcode

## What it does

Adds a single, no-configuration shortcode — `[wc_product_count]` — that outputs the live number of products in your store. It updates as you add or remove products, so copy like “65+ designs and counting” never goes stale.

- Works anywhere shortcodes do: the **Shortcode block**, classic editor, text widgets and most page builders (WPBakery, Elementor…).
- Count one or more **categories** — `[wc_product_count category="apparel,poster"]` — without double-counting.
- Skip hidden products with exclude_hidden="yes". Products whose catalog visibility is set to Hidden aren't counted, so the number matches what shoppers actually see. Example: [wc_product_count category="apparel" exclude_hidden="yes"]
- Count by **status** with `status="draft"` or `status="any"` (default is `publish`).
- Outputs a **plain number** in your site's locale format (e.g. `1,250`) that inherits the surrounding typography.
- **Variable products count once**, however many variations they have.
- No settings page, no database tables, no front-end scripts or styles — just one fast query.

## Setup

1. **Install it.** In WordPress go to **Plugins → Add New → Upload Plugin**, choose the `.zip` you downloaded and click **Install Now**.
2. **Activate it** from the same screen (or later from **Plugins**). WooCommerce needs to be installed and active.
3. **Add the shortcode.** Drop `[wc_product_count]` into any page, post, widget or page-builder text block — e.g. `We have [wc_product_count] designs in the shop.`
4. **Filter it** if you need to: add `category="your-slug"` (slugs are under **Products → Categories**) or `status="any"`. Need a number for one category only? Use [wc_product_count category="your-slug"]. Add exclude_hidden="yes" to leave out hidden products, or status="draft" / status="any" to count by status.
5. **Shortcode example** Basic [wc_product_count] counts all published products. By category (use the category slug, found under Products → Categories) [wc_product_count category="apparel"] counts products in one category. [wc_product_count category="apparel,posters"] counts products in either category. A product in both is counted once. Excluding hidden products (new in 1.1) [wc_product_count exclude_hidden="yes"] counts all published products except hidden ones. [wc_product_count category="apparel" exclude_hidden="yes"] does the same for one category. By status [wc_product_count status="draft"] counts draft products. [wc_product_count status="private"] counts private products. [wc_product_count status="pending"] counts products waiting for review. [wc_product_count status="any"] counts every status except trashed products. Combined [wc_product_count category="apparel" status="draft"] counts draft products in the apparel category. [wc_product_count category="apparel,posters" status="any" exclude_hidden="yes"] counts every status across both categories, without hidden products. In a sentence We have [wc_product_count exclude_hidden="yes"] products in stock shows something like "We have 1,248 products in stock".

## Frequently asked questions

### Where do I find a category slug?

Under Products → Categories in your WordPress admin. Separate several slugs with commas.

### How do I style the number?

Style the text around it. The shortcode outputs a bare number, so placing it inside a heading turns it into a big stat counter.

### Do variations count as separate products?

No. A variable product counts once, no matter how many sizes or colors it has.

### What if WooCommerce is deactivated?

The shortcode quietly outputs nothing — no errors on your pages.

### Is it really free?

Yes — GPL-2.0, free forever, no upsells inside the plugin.

### Can I leave out hidden products?

Yes. Add exclude_hidden="yes" to the shortcode. Products with catalog visibility set to Hidden won't be counted. Products set to "Shop only" or "Search results only" are still counted, because WooCommerce doesn't treat those as hidden.

## Changelog

- **1.0** (2026-07-18): Initial release
- **1.1** (2026-10-22): - New exclude_hidden option: count products in a category (or the whole store) without the ones set to Hidden.; - Added shortcode examples
