Website Building » WooCommerce » How Do I Edit WooCommerce Pagination?

How Do I Edit WooCommerce Pagination?

Last updated on October 1, 2022 @ 6:42 pm

WooCommerce is a powerful ecommerce plugin for WordPress. One of its many features is the ability to customize the pagination on your shop and product pages.

By default, WooCommerce will show 10 products per page. However, you may want to show fewer or more products per page, depending on your store’s layout and design. In this article, we’ll show you how to edit WooCommerce pagination.

To edit WooCommerce pagination, you’ll need to access your site’s code. If you’re not comfortable working with code, we recommend hiring a developer to help you out. Once you have access to your site’s code, open up the functions.php file and look for the following line of code:

add_filter( ‘loop_shop_per_page’, ‘my_loop_shop_per_page’, 20 );

This line of code controls how many products are shown per page. The number “20” in the code above represents the default number of products per page. To change this, simply replace the number “20” with the desired number of products per page.

PRO TIP: When editing WooCommerce pagination, be careful not to accidentally delete or change any critical code. Doing so could break your site. Always back up your files before making any changes.

For example, if you wanted to show 12 products per page, you would change the line of code above to this:

add_filter( ‘loop_shop_per_page’, ‘my_loop_shop_per_page’, 12 );

Once you’ve made your changes, save the file and upload it to your server. Your WooCommerce pagination will now be updated.

Conclusion:

In conclusion, editing WooCommerce pagination is a simple process that can be completed by anyone with basic knowledge of HTML and CSS.

Madison Geldart

Madison Geldart

Cloud infrastructure engineer and tech mess solver.