Mirrors each product's vendor into a normalized 'vendor:<slug>' tag and removes stale vendor tags when the vendor changes or is cleared.
async def run(ctx): for product in await ctx.shopify.query(ALL_PRODUCTS): wanted = f"vendor:{slugify(product.vendor)}" if product.vendor else None stale = [t for t in product.tags if t.startswith("vendor:") and t != wanted]
How do you tag products by vendor on Shopify?
To tag products by vendor on Shopify, this template mirrors each product's vendor field into a normalized vendor tag, lowercased and slugged, and removes stale vendor tags when the vendor changes or is cleared. The raw vendor field is barely usable downstream; a clean tag powers filtered collections, discounts scoped to a brand, and feed rules per supplier, and the normalization means "Acme Studio" and "acme studio" stop being two different brands.
Manual vendor tagging drifts the day a product is re-sourced and the old tag stays behind. Because the mirror runs as code over the whole catalog, a renamed vendor propagates everywhere on the next run: one field edit, and every collection and feed rule follows. The run report shows each tag added or removed, so a supplier consolidation is reviewed once instead of discovered slowly.
Last updated August 24, 2026
If you run a sharper version of this template, or something it inspired, send it in. We review every application and publish the good ones, credited to you or your agency.
AI writes real Python or TypeScript, a dry run rehearses it, you approve, it deploys.
Free plan · no card · 🇪🇺 EU data residency