metafields-metaobjectslisted
Install: claude install-skill khadinakbarlabs/shopify-app-builder
# Shopify Metafields and Metaobjects Guide
## Metafields vs Metaobjects: When to Use Each
### Metafields
**Purpose:** Store custom key-value data on existing resources (products, orders, customers, etc.)
**Use Metafields When:**
- Adding custom attributes to existing resources
- Simple key-value relationships
- Data is tightly coupled to the resource
- Needed in themes (Liquid access)
- Examples: size chart URL, custom color, warranty period, gift message
**Characteristics:**
- Attached to existing resource types
- Simple string or typed values
- Queryable via GraphQL
- Accessible in Liquid templates
- Max 2,500 metafields per resource
- Namespace + key = unique identifier
- Supports display in admin UI via definitions
### Metaobjects
**Purpose:** Define custom data types/records independent of resources
**Use Metaobjects When:**
- Creating independent data structures
- Multi-field records needed
- Reusable data types across shop
- Complex relationships
- Data referenced by multiple resources
- Examples: FAQs, reviews, testimonials, size guides, lookbooks, staff profiles
**Characteristics:**
- Independent data type (like custom table)
- Multiple fields with defined types
- Queryable via GraphQL
- Can be referenced by products/collections via metafield
- Organized in admin UI
- Supports indexing and search
- Better for data that stands alone
**Comparison Table:**
| Feature | Metafield | Metaobject |
|---------|-----------|-----------|
| Attached to resources | Yes |