How To Remove Pagination In WordPress Woocommerce

How to Remove Pagination in WooCommerce: A Beginner’s Guide

So, you’ve got a beautiful WooCommerce store, loaded with awesome products. But you’re hitting a snag: pagination. It’s breaking up your product listing across multiple pages, and you’d rather have them all displayed on a single, scrolling page. You’re not alone! Many store owners want this for better user experience and potentially improved SEO. Don’t worry, this guide will walk you through how to remove pagination in WooCommerce in a way that’s easy to understand, even if you’re a WordPress newbie.

Why Remove Pagination Anyway?

Think about your own online shopping experience. Have you ever landed on a product page and gotten frustrated having to click through multiple pages just to see everything? It can be a drag! Here are a few reasons why removing pagination might be a good idea for your store:

    • Improved User Experience: A single, scrolling page can be easier to navigate and browse, keeping customers engaged longer. Imagine a user searching for “red shoes”. Seeing *all* the red shoes at once is much better than clicking “Next Page” repeatedly.
    • Mobile-Friendly Design: On smaller screens, constantly tapping “Next Page” can be particularly annoying. A long, scrolling list is often a more natural and intuitive mobile experience.
    • Potential SEO Boost: While not a guaranteed win, having all your products on a single page *might* allow search engines to crawl and index them more efficiently. This, combined with improved user engagement (people staying on your page longer), could indirectly improve your SEO.

    However, there are also downsides:

    • Long Loading Times: With *all* products on one page, it could become slow to load, especially if you have hundreds or thousands of items. Think carefully before implementing this if you have a large inventory.
    • Resource Intensive: A very long page can consume more server resources, potentially impacting site performance.

    Weigh the pros and cons before making a decision. If you have a relatively small number of products (under 100, for example), it might be a great option.

    Method 1: Changing WooCommerce Settings (The Easiest Way!)

    This is by far the simplest method. WooCommerce provides a setting to control the number of products displayed per page. By setting this to a large number (e.g., 9999), you effectively eliminate pagination because all your products will fit on a single page.

    1. Log into your WordPress dashboard.

    2. Go to WooCommerce > Settings.

    3. Click on the Products tab.

    4. Under the “Catalog pages” section, find the option labeled “Products per row” and “Rows per page“.

    5. Multiply these two numbers together to find the default “Products per page.” Let’s say it is 4 products per row and 3 rows per page making the default “Products per page” of 12.

    6. Change Products per page to a very large number, like `9999`. This ensures that *all* your products are displayed on a single page.

    7. Click Save changes.

    That’s it! Refresh your shop page and see if the pagination is gone. This is the recommended method for beginners.

    Method 2: Using a Code Snippet (For the Slightly More Adventurous)

    If you’re comfortable adding a little bit of code to your website (don’t worry, we’ll keep it simple), this method gives you a bit more control.

    1. Important: Backup your website! Before making *any* code changes, it’s crucial to back up your website. This allows you to restore your site if anything goes wrong.

    2. Choose where to add the code: There are a few options:

    • Using your theme’s `functions.php` file: This is the simplest, but be aware that if you change themes, you’ll lose the code. *Not recommended for beginners.*
    • Using a child theme’s `functions.php` file: This is the *preferred* method if you’re modifying your theme. Changes in a child theme are not affected when the parent theme updates.
    • Using a code snippet plugin: Plugins like “Code Snippets” are a safe and easy way to add custom code to your site without directly editing theme files. *Recommended for beginners!*

    For this example, let’s assume you’re using the “Code Snippets” plugin.

    3. Install and activate the “Code Snippets” plugin. If you don’t already have it, go to Plugins > Add New and search for “Code Snippets”. Install and activate it.

    4. Add a new snippet. Go to Snippets > Add New.

    5. Enter a title for your snippet (e.g., “Remove WooCommerce Pagination”).

    6. Copy and paste the following code into the “Code” area:

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

    function new_loop_shop_per_page( $cols ) {

    // $cols contains the current Check out this post: How To Change Add To Cart Button Name In Woocommerce number of products per page based on the value set on WooCommerce > Settings > Products

    // Return the number of products you wanna show per page.

    $cols = 9999;

    return $cols;

    }

    7. Select “Run snippet everywhere”.

    8. Save and activate the snippet.

    Explanation of the code:

    • `add_filter( ‘loop_shop_per_page’, ‘new_loop_shop_per_page’, 20 );`: This line tells WordPress to use our custom function (`new_loop_shop_per_page`) to modify the number of products displayed per page.
    • `function new_loop_shop_per_page( $cols ) { … }`: This is our custom function. The `$cols` variable initially holds the default value (e.g., 12) from the WooCommerce settings.
    • `$cols = 9999;`: We’re overriding that default value and setting it to a large number (9999).
    • `return $cols;`: The function returns the new value, which WooCommerce then uses.

    Method 3: Using a Plugin

    Several plugins are specifically designed to manage WooCommerce product display and often include options to remove or customize pagination. This can be a good option if you want more control over other aspects of your shop layout.

    Examples of such plugins include:

    • WooCommerce Product Table Lite: This plugin lets you display products in a table format, which can be a good alternative to pagination. Some of these plugins have the option of infinite scrolling which avoids pagination all together.
    • YITH WooCommerce Ajax Product Filter: This plugin allows customers to filter products, making a long list more manageable without pagination.

    To use a plugin, follow these steps:

    1. Install and activate the plugin. (As shown in method 2).

    2. Go to the plugin’s settings page.

    3. Find the option to remove or customize pagination. The exact location and wording will vary depending on the plugin.

    4. Save your changes.

    Troubleshooting

    • Cache Issues: Sometimes, your website’s cache can prevent changes from showing up immediately. Clear your browser cache and any caching plugins you’re using.
    • Theme Conflicts: In rare cases, your theme might be interfering with the WooCommerce settings. Try temporarily switching to a default WordPress theme (like Twenty Twenty-Three) to see if that resolves the issue.
    • Plugin Conflicts: Another plugin could be interfering. Try deactivating other plugins one by one to see if the pagination disappears.
    • Products Still Showing Pagination: If after increasing the “products per page” setting you are still experiencing pagination, be sure to clear your WordPress cache and any caching systems you have in place.

Conclusion

Removing pagination in WooCommerce can be a great way to improve the user experience and potentially boost your SEO, *especially* if you have a relatively small product catalog. Choose the method that you’re most comfortable with, remember to back up your site before making any code changes, and carefully consider the potential downsides (like longer loading times) before implementing this change. Happy selling!

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *