Change WooCommerce Related Products Display

This is post #8 of 31 in the challenge Mastering WooCommerce

If you want to change ‘Related Products’ display at WooCommerce product page, you can paste below code to the end of your theme functions.php:

add_filter( 'woocommerce_output_related_products_args', 'custom_related_products_args' );

function custom_related_products_args( $args ) {
  $args['posts_per_page'] = 3; // 3 related products
  $args['columns'] = 3; // displayed in 3 columns
  return $args;

function woo_related_products_limit() {
  global $product;
  $args['posts_per_page'] = 3; //set maximum 3 related products
  return $args;

*aboce code only worked for WooCommerce 2.0 and above

Hope it helps. If you like this post, do share with others. Thank you.

Leave a Comment.