Display fresh, random WooCommerce related products on every single product page load (in a slider or not) based on the current product’s category, tags, or attributes.
Related products can be configured to display in posts, pages, and sidebar widgets, and can be configured to exclude categories.
Use the shortcode
[woo-related] for product pages or
[woo-related id='XX'] /
[woo-related product-id='XX' show-title='no'] for posts, pages, and widgets.
Exclude taxonomies using the the option field in the settings page.
The shortcode accepts id, title and number.
will display related products based on product ID 15.
[woo-related id='15' title='no']
is the same as above but will hide Related Products title. For sidebars, etc. you can use the widget title.
[woo-related id='15' title='no' number='1']
is the same as above but will return only 1 product.
will use current product’s ID. This should be used on product pages only.
Related Products for WooCommerce can help you:
- Display real related products (using a slider or not)
- Set the related product’s heading text (you can use HTML)
- Set the number of related products you want to display or disable them
- Set category or tag based related products
- Display related products using Flexslider
- Translate related products heading text
- Exclude taxonomies from your related products
- Use a shortcode to add related products to posts/pages and widgets
Related Products block position
Move related products
Related Products for WooCommerce uses WordPress hooks to display related products on product pages. If you need to move the related products block you can remove the action and add it again using a different hook or priority. This is extremly helpful if you code your own theme or child theme.
To remove related products block you can use
remove_action( 'woocommerce_after_single_product', 'wrprrdisplay' );
in your theme’s functions.php file.
If you want to add it again you can do something like this
add_action( 'woocommerce_after_single_product', 'wrprrdisplay', 55 );
add_action( 'ANY-OTHER-HOOK', 'wrprrdisplay', PRIORITY );
Check GitHub for all single product page actions.
You can see a demo of the plugin here.
- Install the plugin—visit the installation tab for more info
- Use the plugin’s option page, located in the WooCommerce menu, to set up the plugin
- Feel free to use the support forum, and we will get back to you as soon as possible.
Want even better related products?
We recommend trying the Related Products feature that is built-in to PeachPay, an all-in-one checkout and product recommendation solution engineered to increase sales.
Automatic installation is the easiest option as WordPress handles the file transfers itself and you don’t need to leave your web browser. To do an automatic install of Related Products for WooCommerce, log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.
In the search field type “Woo Related Products” and click Search Plugins. Once you’ve found the plugin you can view details about it such as the point release, rating and description. Most importantly of course, you can install it by simply clicking “Install Now”.
The manual installation method involves downloading Related Products for WooCommerce plugin and uploading it to your webserver via your favourite FTP application. The WordPress codex contains instructions on how to do this here.
Automatic updates should work like a charm; as always though, ensure you backup your site just in case.
Contributors and Developers
“Related Products for WooCommerce” is open source software. The following people have contributed to this plugin.Contributors
Translate “Related Products for WooCommerce” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
- Tweak – Update banner message to clarify that PeachPay is an optional upgrade for better related products
- Docs – Update plugin listing
- Tweak – Update banner message
- Tweak – Clarify that future improvements to this plugin will happen in PeachPay, but that this standalone plugin will still work
- Docs – Revise plugin listing description
3.3.2 – 3.3.10 (08/10/2021 – 09/21/2021)
- Dev – Refactor and clean up code; update documentation
- Fix – Function (re)name
- Fix – Conflicts
- Dev – Related products will not include out of stock items
- Fix – Relate by Attribute
- Tweak – Moved action out of the Class
- Dev – Shortcode Refactor
- Tweak – Slider HTML edits
- Tweak – Undefined variable fix
- Dev – Added the abillity to exclude taxonomies
- Dev – Added [woo-related] shortcode
- Tweak – Added woo-related-products-container CSS class to main div
- Tweak – Added woo-related-shortcode CSS class to shortcode’s main div
- Dev – Added the abillity to translate default H2
- Tweak – Added CSS class to H2
- Dev – WooCommerce 3.x functions
- Dev – Relate Products by Product Attributes
- Tweak – Add Style rules
- Tweak – Remove / Edit Functions
- Tweak – Remove / Add Style rules
- Dev – Add Owl-Carousel (boosts compatibility)
- Dev – Remove Flexslider
- Dev – New options to control slider navigation and autoplay
- Tweak – Enable flexslider directionNav (previus – next buttons)
- Fix – Final fix to make smooth the transition from 1.x to 2.x
- Fix – Fix to avoid re post of plugin’s options after upgrading to 2.x [Check forum post] (https://wordpress.org/support/topic/woo-related-products-version-2-0-x/)
- Tweak – Conditional include of libraries
- Fix – Slider ul fix for a few themes
- Tweak – Option for 3 related products
- Dev – Related products Slider
- Dev – Multi category & tags support
- Tweak – Improve Code
- Tweak – Exclude current product from related products
- Fix – Error for products with no category or tag
1.0 – 1.9
- Fix – Bug Fixes
- Dev – Add more options
- Dev – Initial Release