DEV Community

Cover image for Modelling Product Relationships in WooCommerce (Accessories, Bundles, and More)
Chetan Upare
Chetan Upare

Posted on

Modelling Product Relationships in WooCommerce (Accessories, Bundles, and More)

WooCommerce does a lot out of the box.

But when it comes to real product relationships, things get messy very quickly.

Questions like:

  • How do I link accessories to a product?
  • How do I model bundles or kits?
  • How do I create truly related products (not just upsells)?
  • How do I query these relationships cleanly?

Most WooCommerce stores eventually hit this wall.


How WooCommerce handles relationships today

WooCommerce provides:

  • Upsells
  • Cross-sells
  • Grouped products

These work — but they’re opinionated and limited.

They don’t:

  • Model meaning (accessory vs replacement)
  • Support custom relationship types
  • Scale well for complex catalogs
  • Work cleanly outside WooCommerce templates

As soon as your catalog grows, these limitations show.


Common workarounds (and their problems)

1. Product meta fields

Many stores add custom fields to products:

  • accessory_ids
  • related_items
  • bundle_products

This quickly leads to:

  • Meta-heavy queries
  • Poor performance
  • Complex reverse lookups
  • Fragile template logic

2. Taxonomies

Some teams use categories or tags for relationships.

But taxonomies are about classification, not relationships.

A camera doesn’t belong to the “Lens” category —

it has compatible lenses.

The meaning is lost.


3. Custom database tables

Technically correct — but expensive.

You now maintain:

  • Schema
  • Queries
  • Validation
  • Sync logic with WooCommerce

For most stores, this is overkill.


The missing piece: a relationship layer

What WooCommerce really needs is a generic relationship layer that can model:

  • Product → Accessory
  • Product → Replacement
  • Product → Bundle
  • Product ↔ Related product

With:

  • Direction
  • Meaning
  • Clean querying
  • Performance at scale

This is exactly what Native Content Relationships provides.

👉 https://wordpress.org/plugins/native-content-relationships/


How this improves WooCommerce setups

Instead of forcing relationships into meta or taxonomies:

  • Accessories become a one-way relationship

    (Camera → Lens → Tripod)

  • Related products become bidirectional

    (Alternative or similar products)

  • Bundles are modeled explicitly

    (Bundle → Contains → Products)

All without abusing WooCommerce internals.


Why this scales better

With a structured relationship layer:

  • Relationships live in an indexed table
  • Queries are predictable and fast
  • Reverse lookups are trivial
  • Editors manage relationships safely
  • Data remains portable and future-proof

You’re no longer fighting WooCommerce — you’re extending it cleanly.


When this matters most

  • Large product catalogs
  • Stores with accessories or replacements
  • Multilingual WooCommerce sites
  • Headless storefronts
  • Long-lived eCommerce platforms

If your store is growing, relationship modeling becomes infrastructure — not a feature.


Final thought

WooCommerce solves commerce.

It doesn’t solve data modeling.

Once you separate those concerns, complex product relationships become much easier to reason about.

If you need a clean, WordPress-native way to model product relationships, you can explore the plugin here:
https://wordpress.org/plugins/native-content-relationships/

Top comments (0)