Shelf Life Metafield
Prerequisites
Before you begin, make sure you have:
An active Shopify store
Accentuate Custom Fields installed from the Shopify App Store
Staff permissions to access Apps in your Shopify admin
(Recommended) An Online Store 2.0 theme, which allows metafield values to be displayed via the theme editor without touching code
Key Concepts to Know First
Scope — The Shopify object the metafield attaches to. For Shelf Life, this will be Products.
Namespace & Key — The unique identifier for your field. The namespace groups related fields (e.g. custom) and the key is the specific field name (e.g. shelf_life). Together they form custom.shelf_life, which is the address used in your theme to pull the value.
Field Data Type — Controls what kind of data the field holds. For Shelf Life, a Multi-line text field is recommended. Shelf life information is product-specific and often includes multiple pieces of information — storage instructions, unopened shelf life, opened shelf life, expiration date format, and storage conditions. A free-text field allows your team to document complete shelf life information for each product without being restricted to predefined options. If you want to support formatting such as bullet points or headers, choose Rich Text instead.
Step-by-Step Guide
Step 1 — Open ACF from your Shopify Admin Go to your Shopify Admin, click Apps in the left sidebar, and open Accentuate Custom Fields. You'll land on the ACF dashboard, which shows the Metafields and metaobjects section with cards for Products, Shops, Metaobjects, and Customers.
Step 2 — Open Product Metafields In the Products card, click the Metafields button. This takes you into the Product Custom Fields screen where you can see all existing fields listed with their types and manage your definitions.
Step 3 — Add a New Section Click the + Add section button in the top-right area of the Product Custom Fields screen. An Add Section modal will open across two pages.
Page 1 — Basic Details:
Title: Shelf Life — displayed in bold as a visual header when editing product values (1–50 characters, no HTML)
Name: shelf_life — must be unique within your Product fields (3–64 characters, letters, digits, underscores or dashes only)
Description: Optionally add a note like Storage requirements, shelf life duration, and expiration information for this product — supports Markdown
Color: Leave as the default #dfe3e8, or choose a colour to visually distinguish this section from others in your Food & Beverage field setup
All fields in this section apply to: Leave as All types unless you want to restrict this to specific product types
Make visible to the Storefront API: Leave checked (default) — this makes the shelf life information accessible in themes and custom storefronts
Click Next to continue.
Page 2 — Advanced Settings:
Repeatable section: Leave unchecked — shelf life is a single block of information per product, not a repeating block.
Include value of first text field: Optionally check this — since the field is a text field, showing a preview of the shelf life duration in the section header when collapsed can help your team quickly identify expiration information.
Show as collapsed when editing: Optionally check this — shelf life information can be detailed, so collapsing the section by default keeps the product edit page tidy. Editors can expand it when needed.
Hide section: Leave unchecked — checking this would make the section invisible in the editor entirely.
Show section even if empty: Optionally check this if you want the Shelf Life section to always appear on products, even before shelf life information has been added.
Exclude from layout: Leave unchecked — only tick this if you want the section excluded from ACF's layout editing tools.
Click Done to save the section.
Step 4 — Add the Shelf Life Field Once the section is saved, click + Add field to add the actual field inside it. Fill in the details:
Label: Shelf Life
Namespace: accentuate (ACF's default, or use your own e.g. food)
Key: shelf_life
Field Data Type: Select Multi-line text — this gives your team a spacious text area to document complete shelf life and storage information per product. If you want to support formatting such as bullet points or separate sections, choose Rich Text instead.
Step 5 — Save Click Save. Your Shelf Life field will now appear inside its section on every product edit page in your Shopify admin, giving your team a dedicated space to enter storage and expiration information for each product.
Populating Shelf Life Values on Products
One by one: Open any product in Shopify Admin, scroll to the Shelf Life section added by ACF, type or paste the complete shelf life and storage information into the text area, and save. This is the most practical method since every product's shelf life is unique and should be verified against supplier or manufacturer information.
CSV import: Use the Export button to download a CSV template, fill in the shelf_life column for each product row, then re-import via the Import button. This is useful when migrating shelf life data from an existing product database or supplier information.
Displaying Shelf Life on Your Storefront
Theme Editor (no code, OS 2.0 themes): Go to Online Store → Themes → Customize. Open a product template, click Add Block, select an ACF or Metafield block, choose the Shelf Life field, position it on the page (typically in a Storage & Freshness or Product Care section), and save. It will display automatically for any product with shelf life information documented.
Liquid Code (all themes): Add this to your product template file where you want the shelf life information to appear:
For Multi-line text:
{% if product.metafields.custom.shelf_life %}
<div class="shelf-life">
<strong>Storage & Shelf Life:</strong>
<p>{{ product.metafields.custom.shelf_life.value }}</p>
</div>
{% endif %}
For Rich Text:
{% if product.metafields.custom.shelf_life %}
<div class="shelf-life">
<strong>Storage & Shelf Life:</strong>
{{ product.metafields.custom.shelf_life.value }}
</div>
{% endif %}
If you used a custom namespace (e.g. food), replace custom with your namespace name.
Tips & Best Practices
Include specific shelf life duration — be clear about how long a product remains fresh. For example: "12 months from manufacture date when stored unopened" or "Stays fresh for 2 weeks after opening when refrigerated". Vague language like "Best consumed soon" is unhelpful.
Distinguish unopened vs. opened shelf life — most perishable products have different shelf life once opened. Include both: "Unopened: 18 months. After opening: consume within 3 months."
Include storage instructions — temperature, light exposure, and humidity matter for many foods. Always include storage conditions: "Store in cool, dry place", "Refrigerate after opening", "Keep away from direct sunlight", "Best stored at room temperature".
Clarify date format and meaning — be explicit about what the date on the package means. For example: "Best By Date indicates peak freshness (product is still safe after this date if stored properly)" or "Use By Date indicates food safety limit."
Include manufactured or packaged date — if relevant, note when the product was made: "Manufactured on date shown on label. Best consumed within 12 months."
Use Rich Text for complex information — if shelf life information is detailed or includes multiple scenarios, use Rich Text with headers or bullet points. For example:
Unopened: 24 months from manufacture date
Refrigerated (opened): 7 days
Room Temperature (opened): Do not store at room temperature
Storage: Keep refrigerated at 35-40°F
Source information from manufacturers — always obtain shelf life and storage information from your supplier or product manufacturer. Never guess or assume.
Include special handling notes — if a product requires special care, include it: "Handle with care — fragile", "Do not freeze", "Keep away from moisture", "Store upright".
Note differences between retail and customer shelf life — if your product has a different shelf life once the customer receives it versus when it ships, clarify both: "Shipped with 90 days remaining shelf life. Typical customer shelf life is 60-90 days if stored as directed."
Update when formulations change — if a supplier changes preservatives or formulation, shelf life may change. Update this field whenever you learn of changes.
Keep a master reference document — maintain an internal document with approved shelf life information for each product, sourced from supplier documentation. Use this as your source of truth.
Be accurate with dates — false or misleading shelf life claims can harm customers and damage your reputation. Always use verified information from manufacturers.
Include allergen or cross-contamination notes if relevant — if shelf life is affected by allergen exposure or cross-contamination risk, note it: "Contains milk. Keep away from nut-processing equipment."
Consider climate and shipping — if you ship to warm climates, note if shelf life may be reduced during transit: "Shelf life may be reduced during warm weather shipping. Store in cool location upon receipt."
Pair with Ingredients field — display Shelf Life alongside your Ingredients field on the product page. Customers want to know both what's in the product and how long it lasts.
Avoid the shopify namespace — it is reserved by Shopify and can cause conflicts. Use custom or a brand-specific name like food.
Multi-language stores — ACF supports translatable metafields. Mark Shelf Life as translatable if you serve markets where storage terminology differs or where local regulations use different date labeling conventions.
Comply with local regulations — shelf life labeling is regulated in many markets. Ensure your shelf life information complies with local food safety regulations (FDA in the US, EFSA in Europe, CFIA in Canada, etc.).
Quick Reference
Setting
Value
Scope
Products
Section Title
Shelf Life
Section Name
shelf_life
Field Label
Shelf Life
Namespace
custom
Key
shelf_life
Full Identifier
custom.shelf_life
Field Data Type
Multi-line text (or Rich Text for detailed storage info)
Storefront API
Enabled (checked by default)
Liquid Reference
{{ product.metafields.custom.shelf_life.value }}
Critical
Always source from manufacturer documentation; never guess
Best Practice
Include both unopened and opened shelf life durations
Best Practice
Always include storage instructions (temperature, light, humidity)
Best Practice
Clarify what date formats mean (Best By vs. Use By)
Best Practice
Use Rich Text with bullet points for complex storage information
For further details, visit the official ACF documentation at help.accentuate.io
Last updated