This guide explains how to disable WooCommerce pagination so your category pages display every product at once. The provided code snippet modifies the main query to remove page limits, creating a seamless scrolling experience for your customers.
WooCommerce category pagination is a standard navigation system that breaks your product archives into multiple, separate pages. WordPress enables this by default to prevent slow loading times, forcing users to click numbered links (like "Page 1 of 5") to see more items.
Pagination interrupts the natural shopping flow because every click requires a full page reload. Removing these breaks allows mobile users to scroll vertically through your entire catalog, which often reduces bounce rates and encourages deeper browsing.
This PHP snippet intercepts the main WordPress query before it runs to detect if the user is viewing a product category. It then resets the posts_per_page limit to -1, which instructs the database to fetch and display every matching product in a single loop.
add_action( 'pre_get_posts', 'ul_disable_category_pagination' );
function ul_disable_category_pagination( $query ) {
// Check context (Frontend + Main Query + Product Category)
if ( ! is_admin() && $query->is_main_query() && is_product_category() ) {
// Set posts per page to -1 (All)
$query->set( 'posts_per_page', -1 );
}
}You can safely add this code to your child theme's functions.php file or use a snippet manager like the WPCode plugin. I recommend using a plugin because it keeps your custom code active even if you switch or update your website's theme.
Warning: Loading hundreds of products on a single page creates a large DOM size that can strain server resources. Mobile browsers often struggle to render excessive images simultaneously, so this method works best for smaller catalogs.
Infinite scroll provides a similar seamless experience but loads content dynamically via AJAX to save bandwidth. While disabling pagination is easier to implement, infinite scroll is technically superior for site speed and performance on large stores.
Consolidating products onto a single URL concentrates link equity. Deep pagination chains dilute value. Single-page archives help search bots crawl inventory efficiently. This structure lowers the cost of information retrieval. Such efficiency is a core component of an SEO service.
Yes, you can modify the conditional logic in the code to target specific category IDs. This allows you to show all products for small, curated collections while retaining standard pagination for your larger, heavier categories.
Most standard themes respect the main pre_get_posts query modification used in this snippet. However, custom page builders like Elementor often use their own internal loops, so you may need to adjust the element's settings directly.
The visual grid layout remains consistent with your theme's design, but the list expands vertically. Your existing CSS styles will automatically apply to the new rows, so no design changes are required.
SEO audits with a focus on ecommerce platforms
Optimising product, category and filter pages
Structured data implementation (schema markup)
Improving site speed and mobile usability
Link building strategies that support product visibility
Duplicate content checks and canonicalisation
Conversion-focused keyword targeting
Monthly performance and ranking reports
No long-term contract, complete flexibility
Shopify and WooCommerce stores
Businesses with growing product ranges
Online retailers who want organic growth, not just paid ads
You’ve built the store. Now let’s get the right people in front of it — and make sure they convert.
Opening hours
Monday: 09:00 - 18:00
Tuesday: 09:00 - 18:00
Wednesday: 09:00 - 18:00
Thursday: 09:00 - 18:00
Friday: 09:00 - 18:00
Company info
Graham SEO Ltd
Company No.10710878
VAT No. 349888132
Office 2, Oaktree Court Business Centre
Mill Ln, Little Neston, Ness
Cheshire, CH64 8TP
Tel: 0333 335 5902
Copyright © Graham SEO Ltd 2026. All Rights Reserved