---
title: "How to Filter by Multiple SKU on Admin Product Grid in Magento 2?"
url: "https://magecomp.com/blog/filter-multiple-sku-admin-product-grid-magento-2/"
date: "2022-03-18T10:00:03+00:00"
modified: "2025-02-18T06:01:23+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 386
reading_time: "2 min read"
summary: "Hello Magento Friends,"
description: "Instead of filtering products one by one, admin can filter multiple SKU on the product admin grid in Magento 2. Learn how"
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "Magento 2: How to add Custom Field at Hyvä Checkout"
    url: "https://magecomp.com/blog/magento-2-how-to-add-custom-field-at-hyva-checkout/"
  - title: "How to Install Magento SUPEE 8167 With or Without SSH"
    url: "https://magecomp.com/blog/install-magento-supee-8167-with-or-without-ssh/"
  - title: "Laravel 8: Create REST API in Laravel"
    url: "https://magecomp.com/blog/laravel-8-create-rest-api/"
---

# How to Filter by Multiple SKU on Admin Product Grid in Magento 2?

_Published: March 18, 2022_  
_Author: Dhiren Vasoya_  

![How to Filter by Multiple SKU on Admin Product Grid in Magento 2](https://magecomp.com/blog/wp-content/uploads/2022/03/How-to-Filter-by-Multiple-SKU-on-Admin-Product-Grid-in-Magento-2-1024x512.webp)

**Hello Magento Friends,**

Today I am going to throw light on How to Filter by Multiple SKU on Admin Product Grid in Magento 2?
[![Magento Malware Removal](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-Malware-Removal-CTA-6.webp)](https://magecomp.com/magento-malware-removal.html)

While working with the admin product grid in Magento 2, you can filter only one SKU at a time. When admin users need to perform mass actions on the product then first they need to filter the products one by one and then apply mass actions. It becomes a time-consuming process for the admin. Thus, to make the work of the admin quick, I have a solution for it.
**Note:** For tracking all the admin activities [install Magento 2 Admin Actions Log](https://magecomp.com/magento-2-admin-actions-log.html).
With the help of the below steps, the admin can filter multiple SKUs at a time from the admin product grid.
## Steps to Filter by Multiple SKU on Admin Product Grid in Magento 2:
**Step 1:** Create a **di.xml** file in your extension
**app\code\Vendor\Extension\etc\di.xml**

Now, add the code as follows
```
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="MagentoCatalogUiDataProviderProductProductDataProvider" type="VendorExtensionModelProductDataProvider" />
</config>
```

**Step 2:** Now create the **ProductDataProvider.php** file in the following path
**app\code\Vendor\Extension\Model\ProductDataProvider.php**

Then add the code as mentioned below
```
<?php

namespace VendorExtensionModel;

class ProductDataProvider extends MagentoCatalogUiDataProviderProductProductDataProvider
{
    /**
     * @inheritdoc
     */
    public function addFilter(MagentoFrameworkApiFilter $filter)
    {
        if (isset($this->addFilterStrategies[$filter->getField()]))
        {
            $this->addFilterStrategies[$filter->getField()]
                ->addFilter(
                    $this->getCollection(),
                    $filter->getField(),
                    [$filter->getConditionType() => $filter->getValue()]
                );
        }
        elseif ($filter->getField() == "sku" && count(explode(",",str_replace("%","",$filter->getValue()))) > 1)
        {
            $withComma = explode(",",str_replace("%","",$filter->getValue()));

            $attrs = array();
            foreach ($withComma as $cItem)
            {
                $attrs[] = ['attribute' => $filter->getField(), $filter->getConditionType() => '%'.trim($cItem).'%'];
            }
            $this->getCollection()->addAttributeToFilter($attrs);
        }
        else
        {
            parent::addFilter($filter);
        }
    }
}
```

## [![Magento 2 Speed & Performance Optimization Services](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Speed-Performance-Optimization-Services-CTA-2.webp)](https://magecomp.com/magento-performance-optimization.html)

## Conclusion:
Hence, this way you can filter multiple SKUs on the admin product grid in Magento 2.
[**Add any custom filter to Product Grid in Magento 2**](https://magecomp.com/blog/custom-filter-to-product-grid-magento-2/)

If you face any difficulty, let me know through the comment box. Share the article with your friends and stay updated with us for more tutorials.
[![hyva theme development](https://magecomp.com/blog/wp-content/uploads/2025/02/hyva-theme-development-CTA-6.webp)](https://magecomp.com/services/hyva-theme-development/)

**Happy Coding!**


---

_View the original post at: [https://magecomp.com/blog/filter-multiple-sku-admin-product-grid-magento-2/](https://magecomp.com/blog/filter-multiple-sku-admin-product-grid-magento-2/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-10-15 06:37:06 UTC_  
