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

> A client needed product condition (new / refurbished / used) shown on every PDP without editing 800 products by hand.

Original page: https://www.withbranva.com/blog/how-to-add-conditions-in-bulk-shopify-products
Author: Branva (Janani Kumar)

---

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

![Operator building a custom Shopify app to bulk-tag product conditions](https://www.withbranva.com/images/blog-covers/how-to-add-conditions-in-bulk-shopify-products.jpg)

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](https://www.withbranva.com/ai-workflows).

## 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:

-   It couldn't be shown consistently on the product page
-   It couldn't be filtered or merchandised
-   It couldn't be used in feeds (Google Shopping requires a `condition` field)
-   Editing ~800 products by hand to add a structured condition was a multi-day manual job nobody wanted

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

## Table of Contents

-   [The Approach](#the-approach)
-   [The Custom App + Prompt](#the-custom-app--prompt)
-   [Rendering It Dynamically on the PDP](#rendering-it-dynamically-on-the-pdp)
-   [Cost & Time](#cost--time)
-   [What to Watch For](#what-to-watch-for)

## 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:

```liquid
{% 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

-   **Idempotency matters.** The app must skip products that already have the metafield set, or a re-run will re-process everything and waste calls. We made the skip check explicit in the prompt.
-   **Google Shopping condition values are constrained.** Google's feed spec only accepts `new`, `refurbished`, `used`. Map to those exact strings if the metafield feeds your Shopping feed.
-   **Ambiguous descriptions exist.** "Like new" could be new or used depending on the brand's policy. We had the client define the rule once; the app applied it consistently.
-   **Theme dynamic source vs Liquid.** On OS 2.0 themes, prefer the dynamic source approach — it survives theme updates better than custom Liquid edits.

## Talk to Branva

We build custom Shopify apps and AI workflows like this as part of transparent monthly Shopify operations. [Book a free call](https://www.withbranva.com) — 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

-   [The AI Workflows pillar](https://www.withbranva.com/ai-workflows) — every workflow we run, where AI fits, where humans review.
-   [How Do I Add Alt Text to Shopify Images in a Block?](https://www.withbranva.com/blog/how-to-add-alt-text-shopify-images-block) — same custom-app pattern, applied to image SEO.
-   [What an AI Marketing Agency Actually Does](https://www.withbranva.com/blog/what-an-ai-marketing-agency-actually-does) — where this kind of build fits in the broader model.
-   [The Shopify Operator Stack 2026 Edition](https://www.withbranva.com/blog/shopify-operator-stack-2026-edition) — the tools behind workflows like this.
