Add Shopify Product Tags Using SKU Pattern Rules
This workflow applies product tags in Shopify by matching SKU patterns to predefined tag rules. When SKUs match the patterns you set, MESA adds the corresponding tags to those products. The applied tags help build collections, sort inventory, and create customer-facing product filters. Rather than manually tagging products, this workflow maintains consistent product organization as you add new items to your catalog.
Trusted by 1,000+ Shopify merchants — from solo operators to scaling brands.

How it works
10 steps to start auto-tagging products based on SKU patterns
Product Created
Product Created
Tags Mapping To SKU Patterns
Tags Mapping To SKU Patterns
Create array of patterns to loop over
Create array of patterns to loop over
Loop over variants
Loop over variants
Loop over patterns
Loop over patterns
Check regex match of pattern and sku
Check regex match of pattern and sku
Filter: If it matches
Filter: If it matches
Retrieve Product
Retrieve Product
Filter: Check for tag
Filter: Check for tag
Product Add Tag
Product Add Tag
Ready to start auto-tagging products based on SKU patterns
Get setup in 11 minutes.
Frequently asked questions
What happens if a product's SKU matches multiple patterns?
The product receives all matching tags. For example, if you have patterns for "ORGANIC-" → "Organic" and "COTTON-" → "Cotton," a product with SKU "ORGANIC-COTTON-SHIRT-001" gets both the "Organic" and "Cotton" tags applied automatically.
Can I use this for existing products or only new ones?
This template triggers on product creation only, so it tags new products as they're added. To tag existing products, change the trigger to "Product Updated" and make a minor edit to each product (like updating the description), which will trigger the workflow to evaluate and tag based on current SKU patterns.
What if my SKU doesn't have a consistent prefix pattern?
The pattern matching looks for your specified text anywhere in the SKU, not just at the beginning. So a pattern of "TOWEL" will match "BEACH-TOWEL-001," "TOWEL-HAND-SM," or "COTTON-TOWEL-WHITE." Just ensure your pattern text is unique enough to avoid false matches.
Make this template your own!
Customize this workflow even further:
You're in good company
"MESA has been a game changer for us. And, if you ever get stuck, their support team is always super helpful."
"It's like Zapier but exactly designed for Shopify. I have been able to complete all the workflows that I've needed."
"The MESA team has been amazing at helping us set up our automations. We would highly recommend this app!"
Ready to start auto-tagging products based on SKU patterns?
7-day free trial • 11 min setup • Cancel anytime
Need help? Our automation experts will help you personalize this workflow for free. Contact support