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.

Display Total Product Sold Quantity to WooCommerce Product Page

# This is post #4 of 31 in the challenge “Mastering WooCommerce

This snippet code show you how to display total product sold quantity under product title at WooCommerce product page.

Currently your customers have no idea how many quantity or downloads have been ordered from your WooCommerce site. So in order to apply this change, you can add below code into your theme functions.php.