Control number of products per page in WooCommerce

A common question that comes up after someone gets their WooCommerce store setup is about customization. Setting up your store and getting the products loaded in is just part of running any webstore. One of the biggest benefits to WooCommerce is the opportunity for customization.

In the coming posts on WooCommerce we’ll explore some basic customization tasks that come up. Starting with a simple one, say you wanted to adjust the number of products that are shown per page in your shop.

How can I can change the number of products per page?

There are several options available to change the number of products per page. You may only be able to use a few of the methods we’ll provide. Since some of the methods are only supported based on your site’s theme we’ll include a few methods.

Method 1: Using the Theme Customizer

Without a doubt this is the easiest method to do this task with. That said, your mileage may vary – this is a method your theme must support to have available.

  1. From within your WordPress Admin area, find and hover your mouse on the Appearance option.
  2. Inside of the Appearance dropdown click the Customize option. This will open the WordPress theme customizer tool.
  3. Within this tool click the Layout option. If your theme supports it, you will see a Shop Posts per Page where you can control the number of products per page.

If you do not see this option, like the example, then your theme does not have support for this customization option. Don’t worry though, you can still customize this with the other method bellow!

Method 2: Adjust the setting with a filter

If your theme does not have the option, with a little bit of code, you can achieve the same results. So just a little bit a code is needed to do this. Before you go copying and pasting code though you should read our article on managing code snippets. Once you’ve read that article and brushed up on modifying code in WordPress continue on.

Add the following code to your theme’s `functions.php` file, or you can manage the code using the code snippets plugin.

Keep in mind, our example sets the products per page to 9 – in a 3 column page this will be 3 rows. So when you set this number you should be aware of the number of columns your layout has currently.

Be Sociable, Share!

    Author Bio

    About the Author: Dan Pock

    Dan Pock does Technical Writing & Marketing at Liquid Web with a background in System Administration, Public Relations, and Customer Service.

    His favorite things include: his cats, Oscar Boots and Dash Nouget; experimenting with PHP; and making up recipes (or at least attempting to). You can find his coding hijinks on GitHub, where he shares most of his projects and open source work.

    Here's 75 % off, Launch a New VPS Today. Find out why 30,000 customers have chosen our Best-in-Class Performance & 24x7 Heroic Support