Change Number of Products Displayed on Woocommerce Shop Page

By default, the number of products displayed on Woocommerce archive pages (Shop and Category Pages) are controlled in WordPress reading settings , the same as number of posts displayed on blog pages.

Reading Settings

I set the blog page to show 5 posts, so Woocommerce shows 5 products on archive pages, then comes the pagination.

Woocommerce Archive Page Shows 5 Products

To customize this, we just need to paste the following code snippet to functions.php file of active theme.

//Display 24 products on archive pages
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 );

Adjust the number after return to get different results.

Now my services shop should display 24 products, since I only have 8 products, they are all displayed.

Woocommerce Archive Page Shows 8 Products



This entry was posted in WordPress. Bookmark the permalink.

11 Responses to Change Number of Products Displayed on Woocommerce Shop Page

  1. Toyo says:

    Really Thanks! I very need this code.

  2. Umashanakr says:

    Great, thanks!!

  3. Pablo says:

    Great, thanks!!

  4. This was so helpful thank you!!!!!

  5. Bren Murphy says:

    Thanks for this tip – it is as simple as going into Settings > Reading and changing the number of posts. This was limiting the number displayed at the front end. Simple!

  6. anand sharma says:

    thank you for sharing knowledge . very good

  7. Yuriy says:

    Found another solution in case it didn’t help.
    Change it in the product_category function

  8. Yuriy says:

    Doesn’t work for me either. Changed it in both Settings/Reading and functions.php.

    Any suggestions?


  9. bostiq says:

    same here, I’m struggling to find a solution…

  10. Kyle says:

    My blog pages is set to 12 and it only shows 5.

    I also added that code to my functions.php file in my child theme and changed the 24 to 12, but still nothing works. thanks.

  11. Matt says:

    That didn’t work for me. Any idea why that would be? It is the theme’s functions.php not anything to do with woocommerce isn’t it?

Leave a Reply

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