Woocommerce – snippet to change number of products per page.

Want to change the default number of products per page on your Woocommerce store pages from the default of 20? Add the snippet below to your functionality plugin.

Change line #8 to suit your needs, in my example it is set to show 12 products.

/**
* Change WooCommerce products per page
*/

add_filter( 'loop_shop_per_page', 'my_new_products_per_page', 9999 );

function my_new_products_per_page( $pr_per_page ) {
  $pr_per_page = 12;
  return $pr_per_page;
}

It’s that easy!

Leave a Reply

Your email address will not be published. Required fields are marked *