How to remove the pagination on WooCommerce shop page

This article will explore how to remove the WooCommerce pagination in a few different ways.

Have you ever wondered how to remove the pagination on a product category page in the WooCommerce? The WooCommerce pagination is an important part of the page. In pretty much any website, the pagination is only used for when there are multiple products in a same category and their number is larger than the set number of products per page settings. This is because it helps the visitors to easily navigate and find what they wanted to buy.

woocommerce remove pagination

You can deactivate the product pagination on the Product page in WooCommerce via the theme option available here:

Appearance > Customize > Product Page > Product Pagination (uncheck)

If you are building custom pagination or changing the layout programmatically you can achieve the same results with just a few lines of code. Here is a simple code snippet that you can add to your WooCommerce shop and it will remove the default WooCommerce page navigation from the shop page:

remove_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 10 );

Just make sure that you add the code to your child theme functions.php file or if you have a dedicated snippet plugin you can add it in there. Also, keep in mind that with this option, if you have set the products per page to be larger than your current page layout allows, the execs products will not be shown on the page. So when you choose the WooCommerce product number you should also be conscious of the number of columns your layout has currently.

If you want to change the number of products per page programmatically you will need to modify the ‘loop_shop_per_page’. You can overwrite it using the code below. put it on function.php file of your active theme

add_filter( 'loop_shop_per_page', 'my_remove_pagination', 20 );

function my_remove_pagination( $cols ) {

$cols = 90;

return $cols;

}

Where $cols contains the current number of products per page based on the value stored on Options -> Reading.  Return the number of products you wanna show per page.

Unlock the Full Potential of Your WooCommerce Customer Data

Conclusion

WooCommerce, a popular e-commerce platform, allows you to create your own customized store and sell products online. In this article we explored different ways to control the number of products displayed per shop page and whether or not to include WooCommerce pagination. While changing the number of items on each WooCommerce shop page can have an effect on your WooCommerce store performance and improve usability, it is always best to analyze how your changes will impact your store’s SEO before making any big decisions.