How Do I Add Conditions in Bulk for Shopify Products? (Real Workflow)

Operator building a custom Shopify app to bulk-tag product conditions

This is a build-in-public post — a real workflow we ran for a client, the actual approach, and what it cost. Part of our AI workflows pillar.

The customer pain point

The client sold a mix of new, refurbished, and used inventory. The condition was buried inside each product description as free text ("This unit is refurbished and tested…"). It wasn't a structured field, so:

They needed condition as a structured, displayable, filterable field across the whole catalog — without manual editing.

Table of Contents

Key Takeaways

Point Details
The fix Custom Shopify app (built via Shopify's AI app generation) that reads each product description, extracts the condition, and writes it to a structured metafield.
The display The theme's product information block references the metafield as a dynamic variable — so it shows automatically on every PDP, no per-product editing.
Scale ~800 products processed in one run. One-time build, reusable forever.
Why it beats manual Manual = multi-day, error-prone, not repeatable. App = minutes, consistent, re-runnable when new products are added.

The Approach

Three pieces:

  1. Extraction — read the existing product description, identify the condition (new / refurbished / used).
  2. Storage — write that condition into a structured metafield (custom.condition) so it's a real field, not free text.
  3. Display — reference the metafield in the theme's product information block as a dynamic variable so it renders on every PDP automatically.

The key insight: don't edit products manually and don't hardcode condition into the description. Extract once into a metafield, then let the theme read the metafield. New products get processed by re-running the app.

The Custom App + Prompt

We built this with Shopify's AI app generation mode (the prompt-to-app builder inside the Shopify dev tooling). The prompt we used to generate the app logic:

Build a Shopify app that:

1. Loops over all products in the store (paginate via the Admin GraphQL API,
   250 products per page).
2. For each product, reads body_html (the description).
3. Determines the product condition by scanning the description text for
   condition signals:
   - "refurbished", "renewed", "reconditioned" → "refurbished"
   - "used", "pre-owned", "second-hand", "open box" → "used"
   - otherwise → "new"
4. Writes the result to a product metafield:
   namespace: "custom", key: "condition", type: "single_line_text_field"
5. Skips products that already have custom.condition set (idempotent —
   safe to re-run).
6. Logs every product handle + the condition assigned, and a summary
   count at the end.

For products where the description was ambiguous, we added a second pass that sent just the description to the Claude API with this prompt:

You are classifying a Shopify product's condition. Read the product
description below and respond with EXACTLY ONE word: "new",
"refurbished", or "used". No punctuation, no explanation.

Description:
{body_html stripped of HTML}

The deterministic keyword pass handled ~85% of products instantly (near-zero cost). The Claude fallback handled the ambiguous ~15%.

Rendering It Dynamically on the PDP

Once custom.condition exists on every product, the theme reads it. In the product information section (Liquid), reference the metafield as a dynamic variable:

{% if product.metafields.custom.condition %}
  <div class="product-condition">
    Condition:
    <strong>{{ product.metafields.custom.condition | capitalize }}</strong>
  </div>
{% endif %}

If the store uses a metafield-aware theme block (Online Store 2.0), you can add the metafield as a dynamic source directly in the theme editor — no Liquid editing required. Add a text block to the product information section → click the dynamic source icon → select custom.condition.

The result: condition shows on every PDP, pulled live from the metafield. Add a new product, run the app, condition appears. Zero manual work after the initial build.

Cost & Time

Item Estimate
App build (Shopify AI app generation) ~1–2 hours, one-time
Deterministic keyword pass (~85% of products) Free — no API calls
Claude fallback (~15% ambiguous, ~800 products → ~120 calls) A few cents. ~150 input + ~5 output tokens per call. Well under $1 total at typical 2026 model pricing.
Re-running for new products Minutes, near-zero cost (only new products processed)

The honest takeaway: this is mostly a build cost, not a token cost. The AI is doing classification on short text — that's cheap. The value is in never touching 800 products by hand and having a re-runnable system.

What to Watch For

Talk to Branva

We build custom Shopify apps and AI workflows like this as part of transparent monthly Shopify operations. Book a free call — we'll look at what manual work is eating your week and what we'd automate first.

Frequently Asked Questions

Can't I just use Shopify's bulk editor for this?

Only if the condition data already exists in a structured form. The bulk editor edits existing fields — it can't extract condition from inside free-text descriptions. That extraction step is what the app does.

Why a metafield instead of a tag or the product type?

Metafields are purpose-built for structured attributes, render cleanly as dynamic sources in OS 2.0 themes, and don't pollute your tag taxonomy or product-type filtering. Tags work but get messy at scale.

Do I need Shopify Plus for this?

No. Metafields and the Admin API are available on all Shopify plans. Shopify's AI app generation tooling is also available to standard dev accounts.

How do I keep it updated as I add products?

Re-run the app. Because it's idempotent (skips products that already have the metafield), a re-run only processes new products and takes minutes.

Related reading