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

 

 

  11Comments

  1. Toyo   •  

    Really Thanks! I very need this code.

  2. Umashanakr   •  

    Great, thanks!!

  3. Pablo   •  

    Great, thanks!!

  4. Bren Murphy   •  

    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!
    Thanks,
    Bren

  5. anand sharma   •  

    thank you for sharing knowledge . very good

  6. Yuriy   •  

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

    Any suggestions?

    Thanks

  7. bostiq   •  

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

  8. Kyle   •  

    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.

  9. Matt   •  

    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 *