How to Show 60 Products Per Page in WooCommerce Categories (SEO-Friendly Guide)
Introduction:
Are you looking to enhance the user experience on your WooCommerce store and boost your SEO? One effective way to achieve this is by increasing the number of products displayed on category pages. By default, WooCommerce often displays a limited number of products, which can lead to unnecessary pagination and longer loading times. Check out this post: How To Add A Magnifier Button To Woocommerce Images Showing more products per page, like 60, can improve browsing efficiency, increase engagement, and potentially improve your search engine ranking by providing a richer, more comprehensive view of your offerings. This article will guide you through several methods to achieve this, from simple WooCommerce settings adjustments to more advanced code solutions.
Main Part: Setting Up 60 Products Per Page
There are several ways to control the number of products displayed per page in your WooCommerce categories. Let’s explore the most common and effective methods:
1. Using WooCommerce Settings (The Easiest Method)
The simplest method is to use the built-in WooCommerce settings:
1. Navigate to WordPress Admin Dashboard > WooCommerce > Settings.
2. Click on the Products tab.
3. Find the “Products per row” and “Rows per page” settings.
4. *This is important:* While you can specify rows per page, WooCommerce’s default behavior calculates the total number of products based on theme settings and column configuration. You’ll need to adjust *both* “Products per row” and “Rows per page” to reach your desired 60 products. For example, if your theme displays 3 products per row, set “Rows per page” to 20 (3 x 20 = 60).
5. Save changes.
This method works well for many users, but its effectiveness depends on your theme’s customization. If your theme overrides these settings, you’ll need to use another approach.
2. Using the `woocommerce_catalog_per_page` Filter (Recommended Method)
This is the most recommended method because it directly controls the number of products per page using code and is less dependent on theme quirks. You can add this code snippet to your theme’s `functions.php` file or, even better, create a custom plugin to keep your modifications separate and safe from theme updates.
/**
- Change the number of products displayed per page */ add_filter( 'woocommerce_catalog_per_page', 'new_loop_shop_per_page', 20 );
- `add_filter( ‘woocommerce_catalog_per_page’, ‘new_loop_shop_per_page’, 20 );`: This line registers a filter on the `woocommerce_catalog_per_page` hook. This hook allows you to modify the number of products shown on the shop page and category pages. The `20` is the priority Check out this post: How To Make Woocommerce Shop Page Grid of the filter; higher numbers mean it runs later.
- `function new_loop_shop_per_page( $cols ) { … }`: This function takes the current number of products per page as input (`$cols`) and allows you to modify it.
- `$cols = 60;`: This line sets the number of products to 60.
- `return $cols;`: This line returns the modified number of products per page, which WooCommerce will then use.
- Sorting: Allow users to sort products by price, popularity, rating, etc. Discover insights on How To Add A Banner To Storefront Woocommerce Go to WooCommerce > Settings > Products > Display and choose the “Default product sorting” option. “Popularity” or “Average rating” can be good choices to highlight your best-selling or top-rated items.
- Display Type: Choose whether categories display products, subcategories, or both. This option can be found at WooCommerce > Settings > Products > Display under “Category display”.
function new_loop_shop_per_page( $cols ) {
// $cols contains the current number of products per page based on woocommerce settings
// We will set it to 60 here.
$cols = 60;
return $cols;
}
Here’s a breakdown of the code:
Steps to implement this code:
1. Access your theme’s `functions.php` file: You can access this file through FTP or through the WordPress theme editor (Appearance > Theme Editor). *Be careful when editing this file directly!* A syntax error can break your site.
2. Add the code snippet: Copy and paste the code snippet above into the `functions.php` file. Place it before the closing `?>` tag (if it exists).
3. Update the file: Save the `functions.php` file.
4. Alternatively, create a custom plugin: Creating a custom plugin is the safest and most recommended approach.
3. Setting Default Product Sorting and Display Options
To further enhance the user experience, consider setting default sorting and display options for your categories:
4. Remember to Clear Your Cache!
After making any of these changes, clear your website’s cache (if you’re using a caching plugin) to ensure that the changes are immediately visible to visitors. Failing to do so can lead to confusion and make you think your changes haven’t taken effect.
Conclusion:
Increasing the number of products displayed per page in your WooCommerce categories, specifically to 60 products, can significantly improve user experience and potentially boost your SEO. By implementing the methods outlined in Learn more about How To Fully Delete Woocommerce From A WordPress Database this article – starting with the simple WooCommerce settings and, if necessary, moving to the more robust `woocommerce_catalog_per_page` filter – you can achieve the desired result. Remember to choose the method that best suits your technical expertise and theme structure. Always back up your website before making any changes to the `functions.php` file or creating plugins. By providing users with a more comprehensive view of your products, you’ll create a smoother browsing experience, leading to increased engagement and potentially higher conversion rates.