Popular Categories

How to change number of products display in WooCommerce product listing page?

To change the number of products display in WooCommerce product listing page, add the snippet of code to your theme functions.php file. The following code will change the number of WooCommerce products displayed per page.

/**
 * Change number of products that are displayed per page (shop page)
 */
add_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 20 );

function new_loop_shop_per_page( $cols ) {
  // $cols contains the current number of products per page based on the value stored on Options -> Reading
  // Return the number of products you wanna show per page.
  $cols = 9;
  return $cols;
}

Where to add this snippet?
You can place PHP snippets at the bottom of your theme in functions.php file.

Was this helpful?
Did I missed something? Do you have a question? Get in touch.