WooCommerce API Pagination: How to Set Per Page Results in 2026
17 August 2026
Master WooCommerce API pagination per page in 2026. Learn the per_page parameter, limits, and best practices for UK e-commerce developers.
Understanding WooCommerce API Pagination Parameters
When working with the WooCommerce REST API, pagination is essential for managing large datasets. The API uses two primary parameters: `page` and `per_page`. `per_page` controls how many results are returned in a single request, while `page` determines which subset you are fetching. For UK developers, this is particularly important when dealing with extensive product catalogs, customer lists, or order histories. By default, WooCommerce returns 10 items per page, but you can adjust this up to a maximum of 100. The `per_page` parameter is set in the request URL, for example: `/wp-json/wc/v3/products?per_page=50`. Understanding how these parameters interact with response headers like `X-WP-Total` and `X-WP-TotalPages` is key to building efficient integrations.
Setting the Per Page Limit: What UK Developers Need to Know
For UK-based e-commerce sites, choosing the right `per_page` value affects both performance and server load. A higher value means fewer requests, which reduces overhead and is ideal for bulk operations like syncing products to a POS system or a digital marketing platform. However, setting it too high can slow down response times and increase memory usage on your hosting, especially if you have shared hosting from UK providers like 123 Reg or Fasthosts. The API enforces a hard limit of 100 per request. To go beyond that, you must use pagination or implement a custom filter hook, but the standard maximum is 100. We recommend starting with `per_page=50` for most UK e-commerce workflows, balancing speed and reliability.
Practical Examples: Fetching Products with Custom Per Page Values
Let's walk through a typical scenario for a UK online clothing retailer. Suppose you need to fetch all products in the 'hoodies' category. Your request might look like: `GET /wp-json/wc/v3/products?category=123&per_page=100&page=1`. If the total number of hoodies is 250, you'll receive 100 on the first page, 100 on the second, and 50 on the third. To iterate through all pages, you can read the `X-WP-TotalPages` header and loop accordingly. In PHP using the official WooCommerce client, you would use `$woocommerce->get('products', ['per_page' => 100, 'page' => 2])`. Always remember to include your consumer key and secret for authentication. This approach keeps your integration clean and avoids hitting the rate limits imposed by your server or any UK-based API gateway.
Handling Pagination for High Volume UK E-commerce Sites
UK e-commerce sites, especially those selling through multiple channels like Amazon or eBay, often have thousands of products. Pagination becomes a performance bottleneck if not managed correctly. A recommended strategy is to fetch data in smaller batches using `per_page=100` and process each page synchronously, storing the results in a local database or queue. For instance, a UK dropshipping business might need to update prices frequently; using pagination with `per_page=50` and caching responses can prevent server overload. Additionally, consider using the `orderby` and `order` parameters to maintain consistent ordering across paginated requests, which is crucial for incremental updates. Many UK developers also use background jobs (e.g., WP-Cron or external workers) to handle paginated API calls, ensuring that no single request times out or consumes excessive resources.
Common Pitfalls and Best Practices for WooCommerce API Pagination
One common mistake UK developers make is assuming that `per_page` can be set arbitrarily high. Remember, the WooCommerce REST API caps it at 100 by default, but this can be lowered by your hosting provider's PHP settings or plug-ins. Another pitfall is ignoring the Link header, which includes pagination metadata like `next` and `prev` URLs. Best practice is to use these headers for navigating pages rather than constructing URLs manually. Also, be careful with timeouts: fetching a page with 100 large product objects can exceed 30 seconds on slower UK shared hosting. Always set a reasonable timeout in your API client and consider using the `_fields` parameter to only request the data you need. Finally, respect your server's rate limits—if you're making many paginated requests, space them out to avoid 429 errors.
FAQ
The default per_page value in the WooCommerce REST API is 10. This means if you don't specify a per_page parameter in your request, only the first 10 items (e.g., products, orders, customers) will be returned. To get more, you can set per_page to any number between 1 and 100 in your API request URL.