Display the products per page selector with a shortcode #
The Number of Products per Page – Pagination Manager for WooCommerce plugin registers shortcodes so you can place the selector wherever you want it on your shop and product archive pages, for example in an Elementor archive template or a Shortcode block in a block theme’s Product Catalog template. Products per Page provides three shortcodes: two that render the selector, and one for multilingual text.
![the [alg_wc_products_per_page] shortcode rendered above the product grid on the shop page](https://wpfactory.com/wp-content/uploads/products-per-page-for-woocommerce-shortcode-1.png)
Selector shortcodes #
[alg_wc_products_per_page] and [alg_wc_ppp_form] both output the selector form. They are interchangeable: they call the same handler, so pick whichever reads better in your content.
[alg_wc_products_per_page]
Note: the selector only renders where WooCommerce is displaying a product list: the shop page and product category, tag and attribute archives. On an ordinary page or post the shortcode outputs nothing, so add it to your shop or archive template rather than to a regular page.
By default the shortcode inherits the same settings you configured under WPFactory > Products per Page (also reachable at WooCommerce > Settings > Products per Page). You can override individual pieces with attributes.
Shortcode attributes #
| Attribute | What it sets | Falls back to |
|---|---|---|
template |
The text and placeholders around the control | The saved Template setting |
select_class |
CSS class on the control | The saved Selector class |
select_style |
Inline style on the control | The saved Selector style |
before_html |
HTML before the control | The saved Before HTML |
after_html |
HTML after the control | The saved After HTML |
radio_glue |
Separator between radio buttons | The saved Radio glue |
You can also pass the template as the shortcode’s enclosed content. Because a shortcode value cannot contain square brackets, use curly braces for any nested shortcode and the plugin converts them, for example:
[alg_wc_ppp_form]Showing %from% to %to% of %total% {alg_wc_ppp_translate lang="EN"}per page{/alg_wc_ppp_translate} %dropdown%[/alg_wc_ppp_form]
Multilingual text #
The [alg_wc_ppp_translate] shortcode shows or hides text based on the active WPML or Polylang language. It is useful for translating the label around the selector. For full details and examples, see the guide on showing different text per language.
Bonus tip #
Keep Apply in WooCommerce shortcodes enabled in the Advanced section if you also show product grids with WooCommerce’s own [products] shortcode. The per-page value a shopper picks on the shop page then applies to those grids too.
Get more control #
The shortcodes are free. Number of Products per Page – Pagination Manager for WooCommerce Pro adds an editable options list and a Products per Page widget. See what Pro unlocks.