This guide explains how the WooCommerce integration in Contextual Related Posts Pro works and how to configure it effectively for product recommendations.
The integration allows CRP to generate relevant related products using WooCommerce-aware logic, while keeping performance predictable on busy sites.
Quick checklist
Before enabling the WooCommerce integration, make sure that:
- Contextual Related Posts Pro is updated to version 4.3.0 or higher
- WooCommerce is installed and active
- Efficient Content Storage and Indexing (ECSI) is enabled
- Posts and Products have been indexed after enabling custom tables
- At least one product meets the stock and visibility criteria
This guide assumes familiarity with basic WooCommerce and CRP Pro concepts, as well as administrator access to configure settings.
Overview of the integration
The WooCommerce integration does more than display products as related items. It adapts CRP’s matching logic to work with WooCommerce product data and catalog rules, creating a product recommendation system that behaves like native WooCommerce functionality.
Specifically, the integration:
- Indexes product-specific data such as SKUs, attributes, and descriptions
- Respects WooCommerce catalog logic, including stock status and visibility
- Renders output using native WooCommerce templates
- Provides granular control over which product elements are displayed
Enabling the integration
To activate the WooCommerce integration:
- Navigate to Related Posts → Settings in your WordPress admin
- Open the WooCommerce tab
- Enable WooCommerce Integration
- Click Save Changes
The integration requires ECSI (custom tables) to be enabled.
Core settings explained
All settings ship with sensible defaults. You can enable the integration and leave the remaining options unchanged to get immediate, production-safe results.
Product indexing options
These settings control which product data is indexed for matching:
- Index SKU: Includes product SKUs in the index (enabled by default)
- Index product attributes: Indexes custom attributes such as color, size, or material (enabled by default)
- Index purchase note: Includes purchase notes in the index (disabled by default)
Display mode
The Display Mode setting controls how CRP interacts with WooCommerce’s native related products:
- Replace: Removes WooCommerce’s native related products and displays only CRP’s recommendations (enabled by default)
- Coexist: Displays both WooCommerce’s native related products and CRP’s recommendations
Replace mode is useful when you want CRP to handle all related product logic while maintaining a single related products section.
Other display settings include:
- Number of related products to display: This will be the maximum number of related products that will be displayed.
- Related products heading: Heading text displayed above the related products list. Default:
Related products. Leave empty to hide the heading.
Output Customization
Control which elements appear in each related product:
- Product thumbnail
- Sale badge
- Price
- Product Rating
- Add to cart button
All display elements are enabled by default and can be disabled individually as needed.
Product filtering
Fine-tune which products appear in recommendations:
- Exclude hidden products: Filters products excluded from catalog or search (enabled by default)
- Exclude out-of-stock products: Disabled by default
- Same product category only: Limits results to matching categories (enabled by default)
- Same product tag only: Limits results to matching tags (disabled by default)
The above settings will reduce the number of related products that the plugin can find. The Out-of-stock flag is potentially more aggressive if your store has several products that are unavailable to purchase.
How product matching works
The integration uses CRP’s matching engine, adapted for WooCommerce product data. The plugin will use the List Tuning settings, along with the indexed data in the custom table, to find related products.
Advanced users can filter crp_wc_related_products_query_argsOpens in a new window to filter the array of arguments that are passed to CRP_Query.
Output and templates
Related products are rendered using native WooCommerce templates, ensuring visual consistency with your theme.
Template structure
Customization options
Output can be customized using:
- WooCommerce hooks and filters
- Custom CSS targeting
.crp-related-products
You can also override the output using crp_wc_related_products_htmlOpens in a new window to build your own output.
Advanced configuration
Per-product customization
You can override global settings on individual products using the CRP metabox, including:
- Manually defined related products
- Excluding products from recommendations
- Custom keywords for improved matching
Performance optimization
For large product catalogs:
- Review the cache configuration of CRP and/or other caching plugins. I highly recommend using an object cache like Redis
- Consider using the Server Load Threshold feature
Integration with other CRP features
The WooCommerce integration works alongside:
- Bot Protection
- Cache management
- WP-CLI commands for bulk operations
Cart Related Products
When enabled, CRP displays a section on the WooCommerce cart page showing products the customer could add to reach the free shipping threshold. The section only appears when the cart subtotal is below the free shipping minimum for the customer’s shipping zone.
CRP uses the most expensive item in the cart as the relevance anchor and filters candidates to a configurable price band around the remaining gap — so the suggestions are both contextually related and priced to close the gap.
Enabling cart related products
- Navigate to Related Posts → Settings in your WordPress admin.
- Open the WooCommerce tab.
- Enable Enable cart related products.
- Click Save Changes.
The base WooCommerce integration must also be enabled.
Cart settings
Enable cart related products — Displays the cart section when the cart subtotal is below the free shipping minimum. Disabled by default.
Number of cart related products — Maximum number of products to show. Default: 4.
Price upper bound (%) — Controls the width of each price band. CRP queries both a full-gap band and a half-gap band; this percentage widens both. Example: gap = $20, upper bound = 20% → full-gap band covers $20–$24, half-gap band covers $10–$12. Default: 20. Range: 0–200.
Cart section heading — Heading text displayed above the cart section. Leave empty to use the automatic “Add $X more for free shipping” message, where $X is the remaining gap formatted in the store currency. Default: empty.
Cart display position — The WooCommerce action hook where the section is injected on the classic cart page. Options:
- After cart table (default) —
woocommerce_after_cart_table - Before cart collaterals —
woocommerce_before_cart_collaterals - Cart collaterals (sidebar) —
woocommerce_cart_collaterals - After cart section —
woocommerce_after_cart
How cart matching works
CRP resolves the free shipping threshold from the WooCommerce shipping zone matched to the customer’s current package. For guests with no address on file, it falls back to the lowest min_amount across all zones so the nudge still appears on single-zone stores. If no free shipping method applies, the section is suppressed.
The remaining gap is calculated from the cart’s displayed subtotal minus any applied coupon discount (and its tax portion, when prices are displayed including tax), mirroring how WooCommerce itself checks the free shipping threshold. This keeps the suggested gap accurate when a customer has a discount coupon applied.
The most expensive product in the cart is used as the relevance anchor for CRP’s FULLTEXT ranking. Products already in the cart are excluded, and the existing Exclude hidden products and Exclude out-of-stock products settings apply.
CRP queries two price bands and mixes the results:
- Full-gap band — products priced between the remaining gap and
gap × (1 + upper bound %). One product from this band closes the gap alone. - Half-gap band — products priced between half the gap and
(gap / 2) × (1 + upper bound %). Two products from this band together close the gap.
The majority of slots go to full-gap products (so that a single item always closes the gap when the limit is 1), with the remainder filled from the half-gap band. Any unfilled slots are topped up from whichever band has leftover candidates. The final list is shuffled before display so the order varies between page loads.
Filters
crp_wc_free_shipping_thresholdOpens in a new window — Override the resolved threshold for stores with custom shipping logic.
crp_wc_cart_related_products_query_argsOpens in a new window — Modify the query arguments before the cart product query runs.
crp_wc_cart_related_products_headingOpens in a new window — Customize the heading text after it has been resolved.
crp_wc_cart_related_products_htmlOpens in a new window — Filter or replace the complete cart section HTML before it is output.
Styling
The cart section is wrapped in <section class="crp-cart-related-products crp-cart-position-{position}">, where {position} reflects the chosen cart display position — for example crp-cart-position-after_cart_table or crp-cart-position-cart_collaterals. CRP injects scoped inline styles on the cart page to normalize image sizes, apply responsive grid layouts per position, and ensure add-to-cart buttons remain visible.
Target .crp-cart-related-products in your theme CSS to override defaults, or use the position-specific class (.crp-cart-position-after_cart_table, .crp-cart-position-cart_collaterals, etc.) to apply overrides only for a particular cart hook.
Troubleshooting
Related Products from CRP are not showing
- Confirm ECSI is enabled
- Verify products have been indexed
- Check stock status and visibility
- Review query filtering settings
Display issues
- Check theme compatibility with WooCommerce templates
- Review display element settings
- Test with a default WooCommerce theme to isolate conflicts
Performance concerns
- Enable custom tables if not already active
- Review cache settings
- Consider enabling Server Load Threshold
Code examples
The following examples are optional and intended for developers who need finer control over output or behavior.
Customizing the heading based on Source Product ID
Filtering related products
Custom output HTML
Best practices
- Start with the default settings before making changes
- Test recommendations across different product types
- Rebuild indexes after major product updates
- Adjust settings based on customer behavior
- Ensure that Caching is enabled on production sites
- Monitor performance using Query Monitor or similar tools
Frequently asked questions
Why aren’t cart related products showing? The section only appears when all of the following are true: the base WooCommerce integration is enabled, the cart feature is enabled, the customer is on the cart page, and the cart subtotal is below the free shipping threshold for their zone. If no free shipping method is configured in WooCommerce, or if the cart total already meets the threshold, the section is suppressed. CRP searches two price bands (full-gap and half-gap), so products from either band qualify. If Price upper bound (%) is set very low and your catalog has limited price points near the gap, neither band may return results — try raising the percentage.
Does this work with product variations? Variations are indexed through their parent product, and recommendations link to the main product page. Individual product variations will not appear as related products.
Can related products be shown on non-product pages? The integration is designed for single product pages, but CRP shortcodes and blocks can be used elsewhere.
How does this affect page load times? With ECSI enabled, related product queries are typically fast. However, related queries tend to be heavy, so it is advisable to enable caching.
Can the “Related products” heading be translated? CRP includes a wpml-config file, which supports WPML and Polylang. You can also use code to filter crp_wc_related_products_headingOpens in a new window for incremental translation.
Getting help
If you need assistance:
- Review the Contextual Related Posts knowledge base
- Submit a support ticket
- Refer to the CRP CLI documentation for advanced management
The WooCommerce integration builds on CRP’s existing relevance engine while respecting WooCommerce’s catalog rules, allowing you to create product recommendations that remain fast, accurate, and predictable under load.
See also
crp_wc_related_products_query_argsOpens in a new windowcrp_wc_related_products_htmlOpens in a new windowcrp_wc_free_shipping_thresholdOpens in a new windowcrp_wc_cart_related_products_query_argsOpens in a new windowcrp_wc_cart_related_products_headingOpens in a new windowcrp_wc_cart_related_products_htmlOpens in a new windowcrp_wc_related_products_headingOpens in a new window



