# Products per Page on the Shop

> Sets how many products are shown per page on the shop and product category pages.

- Type: PHP
- Runs: Run everywhere
- Category: [WooCommerce](https://wpide.com/library/category/woocommerce/)
- Requires: WooCommerce
- Tags: woocommerce, shop, pagination
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-products-per-page/

## Code

```php
add_filter( 'loop_shop_per_page', function () {
    return 24;
}, 20 );
```

## Notes

Applies to classic shop templates. Block themes set this in the Product Collection block.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Products per Page on the Shop" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
