A bit ago I wrote a post on finding your post or category ID in WordPress. You know, that thing that some plugin or theme might ask you for?
Well, believe it or not, it’s even easier with WooCommerce products.
Why Do I Need to Know My Product ID?
You may be here already because of the frustration of needing to find your product ID in WooCommerce and Google sent you this way. But if not, often there will be settings in some themes or plugins that will ask you for this. An example might be a plugin that list WooCommerce categories. It may give you the option to exclude certain categories in that list, but it doesn’t allow you to do it by the category name, but by the category ID. Or maybe the same applies for listing some products. In any case, if you don’t know where to find it, it can be a pain.
Finding Your WooCommerce Product ID
WooCommerce makes it simple. All you need to do it rollover the product.
But as I mentioned in my other post, you can also find it at the bottom of the browser window, which use to be the easiest way.
Here you can see how that number matches it.
The ID For Any Custom Post Type
Remember, not all eCommerce plugins are equal. And some may not show it under the product name. So keep this other trick in mind. In fact, just about any plugin that creates any post type will work. It could be a event calendar, forms, gallery or any other plugin. In fact in some plugins, for example FooGallery, you will see the ID in the shortcode.
So the next time you need to find an ID for a product, or perhaps something else I hope this short tutorial has saved you a bit of time and frustration.