Skip to content

How to Show WooCommerce Product by Product Id in WordPress?

[rank_math_breadcrumb]

Table of Contents

Categories and tags decide which products appear as a group. Sometimes you want exactly these three products, in this order, on this landing page.

Listing product IDs pins the selection so nothing new drifts into it.

Before You Start

  • Edition: Pro — the Product Listing block needs Nexter Blocks Pro.
  • Block to enable: Product Listing, switched on under Nexter > Blocks in your WordPress dashboard.
  • WooCommerce active, with published products. The block reads your real catalogue, so an empty store renders an empty listing.
  • The product IDs you want. The ID is in the URL when you edit a product, as post=123.

Video Tutorial

A Product Listing showing only the three specific product IDs entered

Steps

  1. Find the ID of each product you want to show.
Finding the product ID
  1. Select your Product Listing block.
  1. Enter the IDs in the include field, separated by commas.
  1. Publish and confirm exactly those products appear.

How It Behaves

The included IDs restrict the query to those products and nothing else.

  • Measured on a published page: a listing given two product IDs rendered exactly two products, and no others.
  • It is a comma separated list, so several products can be pinned at once.
  • The selection is fixed. New products never drift in, which is the point on a landing page or a campaign.
  • There is a matching exclude field for the opposite case, where you want everything except a few.
  • Measured with Nexter Blocks Pro deactivated: the block renders nothing at all — no wrapper, no products, no prices. This is a Pro-only block.

Limitations

  • Pro only — measured with Nexter Blocks Pro deactivated, nothing renders.
  • It is a manual list that nothing maintains. A campaign set up months ago quietly keeps showing the same products.
  • IDs are not human readable. Six months later the field says 412, 908 and nobody remembers why.
  • A deleted or unpublished product simply disappears from the listing with no warning, so a page can quietly end up showing two products instead of three.
  • For a selection that maintains itself, use a category or the featured flag — see display featured products.

Troubleshooting

A product is missing from my list

Check it is still published and in stock if your listing hides out-of-stock items. An unpublished product drops out silently.

Where do I find the product ID?

Open the product for editing and read it from the address bar, as post=123.

The order is not what I entered

The listing still applies its own ordering. Set the ordering to suit, or accept the default.

I want everything except a few products

Use the exclude field instead of the include field.

Related Docs

Share your Thoughts

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!