Tutorial: Replace WooCommerce's Related Products
Take over the box under your product tabs, with products you choose and an order you control. About 10 minutes, free plugin only.
WooCommerce's own Related products box picks products that share a category or tag with the one being viewed, then shuffles them. That's fine until it recommends a $4 sticker under a $400 jacket, or shows something you can't ship.
In this tutorial you'll replace it with the same idea done deliberately: same category, but in stock, sensibly priced, and in an order that favours what actually sells.
What you'll end up with
A grid of four products under the tabs of every product page, in the spot where WooCommerce's related products used to be. Just one box, not two.
Step 1: Start from the template
Go to Recommend → New Recommend. The Create a Recommendation window opens. Under Improve Existing WooCommerce Slots, choose Related Products. Its Default Slot badge means it sits where WooCommerce's own section does.
The builder opens on the Setup tab with this already filled in:
- Show On: Product. It reads the product the shopper is viewing.
- Position On Page: Product page · After tabs, WooCommerce's related-products spot.
- How Products Are Chosen: Rules (Default)
- Filter Type: Same Category & Tags, the automatic pool for product pages
- Sorting: no rules yet
- On Design: Grid, with the heading "Related products"
Give it a name you'll recognise in six months. Click the name at the top of the builder (it starts as Related products) and type something like "Related products — in stock, by popularity".
Step 2: Narrow the pool
Stay on Setup. Filter Type is already matching products in the same categories and tags. You're going to narrow that pool, not replace it.
- Turn on Additional Filters. Filters you add here narrow the automatic pool rather than replacing it.
- Click Add Filter and choose In Stock. Set it to Yes.
- Click Add Filter again (it now reads Add AND Group) and choose Price. Set it to Is Over, then enter a sensible minimum for your store.
Why In Stock? Recommending something you can't ship is worse than recommending nothing. If your store already hides out-of-stock items (WooCommerce → Settings → Products → Inventory), they're dropped anyway, so this filter is a safety net for stores that show them.
Why a price floor? This is the "$4 sticker under a $400 jacket" fix. If your catalogue covers a wide price range, a minimum price stops cheap accessories filling every recommendation.
Watch the Live Preview while you do this
The right-hand pane updates as you change things. It uses the same engine as the storefront, run against a real product from your catalogue (the banner names which one). If it empties out, you've narrowed too far, and you've found out before shoppers do.
You won't see Category or Tag in the filter list while Filter Type is automatic, because the automatic pool already matches on them.
Step 3: Choose an order
Still on Setup, look at Sorting. With no rules, the help line warns you: "No rules — matching products come back in a random order, reshuffled on every page view." That's how WooCommerce's own box behaves too. You can do better.
Click Add Sorting Rule and add two:
| Rule | Setting |
|---|---|
| Popularity | Popularity window: Last 30 Days |
| Price | Direction: Low To High |
Every rule counts the same, and they're blended into one order. There are no weights to set: you shape the order by choosing which rules to include. Here, products that sell well and are cheaper rise to the top. For a browsing box like this, where the shopper isn't committed yet, that tends to convert well.
Try removing the Price rule and watch the preview change. There isn't one right answer, but you can see the difference straight away.
Step 4: Set the heading
Click Continue to go to Design. Grid is already selected as the Display Style, and Products to Show is 4. Both are good choices for this spot.
In Heading Shown to Shoppers, the template set "Related products". That's honest, but it doesn't do much work. Better options, depending on what you sell:
- "Popular in this category": accurate, now that it's sorted by popularity
- "More in this category": sets a clear expectation
- "You might also like": the neutral choice
Don't promise something the block doesn't deliver. It's sorted by popularity, not co-purchases, so "Frequently bought together" would be a claim the shopper might catch.
You can skip Display Conditions for this one. With no conditions, it reads "No conditions yet — this block is always shown.", which is exactly what you want.
Step 5: Save
Click Save Changes. A new Recommendation goes live as it's saved, and you'll see "Recommendation created — storefront updated".
Step 6: Hide WooCommerce's own box
Right now your block and WooCommerce's Related products are both on the page. The template puts your block in the same spot, but it doesn't remove WooCommerce's section.
Go to Recommend → Settings → General. Under WooCommerce Default Showcase, turn on Hide Related Products.
Understand what this does before you move on: it hides WooCommerce's related products on every product page, unconditionally. If your block doesn't show on some page (for example, a product whose category has nothing in stock above your price floor), that page will have no related-products section at all, rather than falling back to WooCommerce's. That's why Step 8 matters. Replacing Woo Slots covers this trade-off in detail.
Step 7: Check the storefront
Open a product page in a private window. You should see:
- Your block below the tabs, with your heading.
- Exactly one related-products box.
- Products that are in stock and above your price floor, with the better sellers first.
Reload a couple of times. The order should stay the same, because you added sorting rules.
Step 8: The check people skip
Open a product in your smallest category.
This is where a narrow pool shows up. If that page has no block, your filters are too tight for part of your catalogue. The block has nothing to show, so it doesn't render, which is correct behaviour producing an unwanted result. And because you've hidden WooCommerce's box, the page now has no related products at all.
Two fixes:
- Lower the price floor. This is usually enough.
- Remove the Price filter and rely on sorting instead. Sorting by Price — Low To High or High To Low pushes cheap items down without removing them, so a small category still gets a block.
The second is often the better choice: a filter is a hard limit, a sort is a preference.
What you learned
- Templates fill in the setup, not the cleanup. A Group A template puts your block in WooCommerce's spot; hiding WooCommerce's own section is a separate, store-wide switch.
- Automatic filters combine with yours. Turning on Additional Filters narrows the automatic pool rather than replacing it.
- No sorting means random. Add at least one rule for a stable order. Rules are blended, each counting the same.
- Filters are hard limits, sorting is soft. Prefer a sort when you want a tendency rather than a boundary.
- Empty blocks don't render. That's correct, and it's why you should test your sparsest category.
Next
- Frequently Bought Together: the next tutorial.
- Step 1 · Setup: the full filter and sorting reference.
- Replacing Woo Slots