How to Set Number of Products Per Page WooCommerce

Number of Products Per Page WooCommerceDo you want to change the number of products per page in your WooCommerce store? In today’s post, we will discuss an easy way to set the number of products displayed. However, you need some technical skills before you proceed. We will try to explain each step in detail to help you implement this solution.

WooCommerce, by default, displays 16 products per page. In addition, they are spread across 4Rows*4Columns. If you have many products in your online store, you might want to customize the number of products to be displayed on the shop page. This could be because of widgets, images, or other design aspects colliding with the number of products displayed.

It is worth mentioning that if you are using default themes like Twenty Seventeen, Twenty Nineteen, or Storefront, you can change the number of products in the “WooCommerce” settings of the theme. In addition, some themes come with third party settings to change the number of products per page.

However, some themes do not show the default WooCommerce setting or a custom setting for changing the number of products. This means that you have to come up with a custom solution for this problem. This is why we created this guide to help you out.

Number of Products Per Page WooCommerce

By the end of this post, you will be able to reduce or increase the number of products displayed per page. In addition, we will also show you how to change the number of columns per page.

Before you proceed, we recommend installing or creating a child theme. This is because we will be editing some of WooCommerce’s core files. Having a child theme installed will ensure that your changes are not lost during an update.

Let us get right into it.

Steps to Change the Number of Products Per Page

Here are the simple steps you need to follow:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file to add the function to change the number of products on the shop page.
  3. Add the following code to the php file:
[php] // Change the Number of WooCommerce Products Displayed Per Page
add_filter( ‘loop_shop_per_page’, ‘njengah_loop_shop_per_page’, 30 );
function njengah_loop_shop_per_page( $products ) {
$products = 12;
return $products;
}

[/php]
  1. If it does not work, you can use the following code snippet:
[php] // Change the Number of WooCommerce Products Displayed Per Page
add_filter( ‘loop_shop_per_page’, create_function( ‘$products’, ‘return 12;’ ), 30 );
[/php]
  1. Alternatively, if you want to change the number of columns per page, add the following code snippet:
[php] // Change the Number of Columns Displayed Per Page
add_filter( ‘loop_shop_columns’, ‘njengah_loop_shop_columns’ );
function njengah_loop_shop_columns( $columns ) {
$columns = 5;
return $columns;
}

[/php]
  1. This is the outcome:columns

Wrapping Up

In this post, we have shared code snippets to change the number of products per page in WooCommerce. However, the last snippet helps you to change the number of columns on the shop page. They have been tested, and we know they will work for any WooCommerce store.

This is the most recommended way of making customization. Having too many plugins will bloat your site.

If you need additional functionality, you can consult a qualified WordPress developer. This will ensure that you do not break your site.

Similar Articles