Skip to content
Aaron Carmen
WooCommerce

Product ID in WooCommerce: Where to Find It (and Variation IDs)

By Aaron CarmenUpdated October 20, 20264 min readTested on WordPress 7.1.3, October 20, 2026

Quick answer

To find a product ID in WooCommerce, go to Products, All Products and hover over the product: the ID is the first thing under its name. Variation IDs show as numbers like #56 in the product's Variations tab. The product ID isn't the SKU. You need the ID for shortcodes, add-to-cart links and many plugin settings.

On this page
  1. 1. Hover over the product in the Products list
  2. 2. Open the product, for the ID and variation IDs
  3. 3. Find it on the front end, without logging in
  4. 4. Get many IDs at once
  5. Category and tag IDs work differently
  6. Copies get a new ID
  7. When you’ll need the product ID

Product ID in WooCommerce questions usually come up when a plugin, a shortcode or a developer asks for “the product ID” and you can’t see one anywhere. I set up a small test store on WooCommerce 11.2.1 with simple products and a product with sizes, and found the ID in each place it shows.

1. Hover over the product in the Products list

The quickest way. Go to Products → All Products and hover over the product’s name. The first item in the row of links underneath is the ID.

WooCommerce Products list with the Night Guard product hovered, showing ID: 55 above Edit, Quick Edit, Trash, View and Duplicate, and a separate SKU column
Hovering over a product shows its ID first. The SKU column next to it is a different code. WooCommerce 11.2.1 on WordPress 7.1.3, October 20, 2026.

On my test store, hovering over the Night Guard showed ID: 55. The SKU column right beside it showed NG-03, which is a different thing.

Product ID vs SKU

  • The product ID is a number WordPress assigns automatically when the product is created. You can’t change it, and plugins and shortcodes use it.
  • The SKU is a code you choose, for stock, accounting or your supplier. It’s optional.

If a plugin asks for a product ID and you enter the SKU, it won’t find the product. You set or change the SKU yourself in the product’s Product data box, on the Inventory tab. Variations have their own SKU field too, inside each variation, so a size or color can have its own code for stock and accounting.

2. Open the product, for the ID and variation IDs

Click into the product. Its ID is in the browser’s address bar, after post=: on my test store, post.php?post=55&action=edit.

Products with options, such as sizes or colors, have a separate ID for each option. Scroll to Product data, choose Variations, and each one is listed with its ID first:

WooCommerce Product data Variations tab listing variation 57 Large and variation 56 Small
Each variation has its own ID: #57 for Large and #56 for Small. WooCommerce 11.2.1, October 20, 2026.

Use the variation ID when you want a specific option. Use the parent product’s ID, 55 here, when you mean the product as a whole.

3. Find it on the front end, without logging in

If you don’t have access to the dashboard, the ID is in the page’s code:

  • On a product page, view the source (Ctrl+U, or Cmd+Option+U on a Mac) and search for postid-. My Night Guard page had postid-55.
  • On the shop page, each add-to-cart button carries data-product_id, with the product’s ID as its value.

One thing I hit on my test store: a brand-new WooCommerce store starts in coming soon mode, so visitors see a “Great things are on the horizon” page instead of your products. The postid- class was still in the code, but the shop’s buttons only appeared once I set the store live under WooCommerce → Settings → Site visibility.

4. Get many IDs at once

Hovering works for one product. For a whole catalog, there are two faster routes.

Export your products. Go to Products → All Products → Export and download the CSV. WooCommerce’s exporter includes an ID column by default, alongside the SKU, name and price, so you get every product’s ID in one spreadsheet. Variations are exported as their own rows with their own IDs.

Ask the store directly. WooCommerce has a public Store API that your shop’s own cart and checkout use. Adding /wp-json/wc/store/v1/products?search=guard to my test store’s address returned the Night Guard with its ID (55), its SKU and its variation IDs (56 and 57), without logging in. Replace “guard” with a word from your product’s name. It only lists products that are published and visible in your shop.

Category and tag IDs work differently

Product categories and tags have IDs too, and some plugins ask for them. Unlike products, they don’t show the ID when you hover. On my test store, Products → Categories only offered Edit, Quick Edit and View. The ID is in the address of the edit link instead: hover over Edit or open the category, and look for tag_ID= in the address bar. My Uncategorized category was tag_ID=19.

Copies get a new ID

IDs are permanent, but each product gets its own, so a copied product is a different product as far as plugins and links are concerned. WooCommerce has its own Duplicate link under each product in the list. On my test store, duplicating the Whitening Kit (ID 53, SKU WK-01) created a draft called “Whitening Kit (Copy)” with ID 59 and SKU WK-01-1, then opened it for editing.

So if you rebuild a product by copying it and deleting the old one, update anything that pointed at the old ID: add-to-cart links, shortcodes, discount rules and plugin settings. Links that still use the old ID will stop working.

When you’ll need the product ID

  • Add-to-cart links. Add ?add-to-cart= and the ID to your site address, for example yoursite.com/?add-to-cart=53. On my test store that put the Whitening Kit straight into the cart, and ?add-to-cart=56 added the Small Night Guard. Adding &quantity=2 sets the quantity: ?add-to-cart=54&quantity=2 put two toothbrushes in my test cart. It’s handy for buttons in emails or on a landing page.
  • Shortcodes, which show specific products on a page; see my guide to WooCommerce shortcodes.
  • Plugin settings, such as product-specific discounts, upsells or shipping rules.
  • Support requests, where a developer asks which product is affected.

If you’re setting up a store and want product links, variations and checkout working properly from the start, that’s part of my WordPress development work. Weighing WooCommerce against a hosted store? See WooCommerce vs Shopify.

FAQ

Common questions

Is the product ID the same as the SKU in WooCommerce?

No. The ID is a number WordPress gives every product automatically and you can't change it. The SKU is a code you choose, like WK-01, usually for stock and accounting. On my test store, the Whitening Kit had ID 53 and SKU WK-01.

How do I find a variation ID?

Open the product, go to Product data, Variations. Each variation is listed with its ID first, like #56 for Small and #57 for Large on my test store. You need the variation ID, not the parent product ID, to add a specific size or color to the cart with a link.

Can I find a product ID without logging in?

Yes. Open the product page, view the page source and search for postid-, which is followed by the ID. On the shop page, each add-to-cart button carries data-product_id with the ID. Both were there on my test store, even while it was in coming-soon mode.

Can I make a link that adds a product straight to the cart?

Yes. Add ?add-to-cart= and the ID to your site's address, for example yoursite.com/?add-to-cart=53. On my test store that added the product to the cart, and using a variation ID added that exact size.

Aaron Carmen, SEO specialist

About the author

Aaron Carmen

Senior WordPress Developer and SEO Specialist

I've built and optimized WordPress websites since 2013, 13+ years in total, including 9.5 years building WordPress sites for every client of a dental marketing agency. Today I help local businesses and agencies with WordPress development and SEO, so they get found on Google Search, Google Maps and AI search.

Sources

  1. WooCommerce on WordPress.org, checked October 20, 2026
  2. WooCommerce documentation: Managing products, checked October 20, 2026

WordPress is a trademark of the WordPress Foundation. Aaron Carmen is not affiliated with or endorsed by the WordPress Foundation or the WordPress open source project.

Contact

Want this done for you?

Tell me about your site and what you need. I'll reply within one business day with any questions, then a fixed quote.

  • Reply within one business day
  • No obligation, no hard sell
  • Form and email only, calls optional
What you need

Prefer email? hello@aaroncarmen.com