Magento - How to show all products of a category in only one page

Magento - How to show all products of a category in only one page

July 5, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento - How to show all products of a category in only one page

Displaying All Products of a Category on One Page in Magento

As a Magento developer, I often receive requests from clients looking to optimize their site’s performance by displaying all products within a specific category on a single page without the default toolbar pager. This can significantly improve user experience and load times for categories with a large number of products.

Understanding the Default Magento Behavior

By default, Magento splits product listings across multiple pages using the toolbar pager. While this is great for navigation and SEO purposes, it might not be ideal for all scenarios. If your category contains a manageable number of products (around 50-100), you can choose to display them all on one page.

Modifying the Layout File

To achieve this, we need to modify the layout XML file responsible for rendering the category view. The catalog_category_view.xml file under your theme directory is where you’ll make these changes.

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generated.xsd">
    <update handle="catalog_category_layered"/>
    <referenceContainer name="content.aside">
        <referenceBlock name="category.products.list" after="products_list_toolbar" remove="true"/>
        <block class="Magento\Framework\View\Element\Template" name="category.all-products-list" template="Magento_Catalog::product/list.phtml"/>
    </referenceContainer>
</layout>

In the above snippet, we’re removing the default products_list_toolbar block and replacing it with a new block called category.all-products-list. This new block uses the default Magento product list template.

Adjusting the PHP Code

Next, you need to adjust the PHP code in your category view controller. Open the file app/code/Magento/Catalog/Controller/Category/View.php and find the _initProductListAction() method.

public function _initProductListAction()
{
    // ... (existing code)

    $this->productCollection = $this->_getProductCollection();

    if ($this->displayMode == 'page') {
        $this->productCollection->setPageSize($this->pageLimit);
    }
}

Here, we’re checking the displayMode of the category. If it’s set to ‘page’, we manually set a page size equal to the total number of products in that category.

Setting the Category Display Mode

By default, Magento uses ‘static’ mode for categories, which doesn’t allow this kind of customization at the category level. You’ll need to change it to ‘page’ within your theme’s layout XML file:

<referenceContainer name="category.products" displayMode="page"/>

Conclusion and Next Steps

Displaying all products in a single page requires some careful adjustments to Magento’s core files, which can pose risks if not handled correctly. I recommend keeping a backup of the original files before making any changes.

Remember, this approach might not always be optimal for large product counts or categories with complex filtering requirements. In such cases, consider using layered navigation or infinite scrolling instead.

For more advanced customizations to your Magento site, consider reaching out to our team at Laravel Company. We specialize in helping businesses like yours optimize their e-commerce performance and user experience through expert Magento development services.

Don’t hesitate to let me know if you have any further questions or need assistance with this process. I’m always here to help!

Catalog Performance Themes SEO

Our network