Custom Fields

Wash can send a post's custom fields to Shopify as article metafields, so your theme can show them. It covers plain WordPress custom fields (post meta), Yoast and Rank Math SEO data, and Advanced Custom Fields (ACF).

Metafield sync is part of the Pro plan and above. ACF fields need the Business plan or above.

What syncs where

Wash puts each kind of field in its own metafield namespace:

SourceShopify namespaceExample
WordPress core datawashwash.wp_permalink, wash.featured_image_url
Yoast SEO, Rank Mathwash_seowash_seo.meta_title, wash_seo.meta_description, wash_seo.focus_keyword
ACF fieldswash_acfwash_acf.subtitle
Other custom fieldswash_customwash_custom.reading_time

The core fields are wp_post_id, wp_permalink, wp_post_type, wp_modified_date and featured_image_url.

Keys are lowercased, anything other than letters, digits and underscores becomes _, and keys are cut to 64 characters. Custom fields whose names start with an underscore are WordPress internals and are skipped.

Turning it on

Meta Fields Configuration in WordPress

  1. Go to Settings > Wash Connector and open the Sync Settings tab
  2. Make sure Sync Metafields is ticked (it is by default) and save
  3. Open the Meta Fields tab
  4. Click Refresh Fields. Wash scans your posts and lists every field it finds, with its Namespace, Source and Type
  5. Switch on Sync for each field you want in Shopify

Each switch saves straight away and the choice is copied to the Wash app ("Saved & synced to Shopify"). The first time a post with that field syncs, Wash creates the metafield definition in Shopify for you, so you don't have to add it under Settings > Custom data yourself.

The same list is in the Shopify app, under the connection's Settings > Meta Fields.

The Meta Fields tab in the connection settings in Shopify

Field types

Wash picks the metafield type from the field. For ACF it uses the field's own type:

ACF field typeShopify metafield type
Text, Email, Select, Radio, Button GroupSingle line text
Textarea, WYSIWYGMulti-line text
NumberDecimal
RangeInteger
True / FalseBoolean
URL, Image, File, Page Link, oEmbedURL
Date PickerDate
Date Time PickerDate and time
Color PickerColor
Post Object, UserInteger (the WordPress ID)
Checkbox, Link, Relationship, Taxonomy, Google Map, Gallery, Group, Repeater, Flexible ContentJSON

For plain custom fields, Wash looks at the stored value: numbers become numbers, true/false becomes a boolean, and anything else is text.

Using metafields in your theme

Optional fields can be empty, so wrap them in a check.

Reading time

{% if article.metafields.wash_custom.reading_time %}
  <span class="reading-time">
    {{ article.metafields.wash_custom.reading_time }} min read
  </span>
{% endif %}

Call to action from ACF

With an ACF group holding cta_text (Text) and cta_url (URL):

{% if article.metafields.wash_acf.cta_text %}
  <a href="{{ article.metafields.wash_acf.cta_url }}" class="cta-button">
    {{ article.metafields.wash_acf.cta_text }}
  </a>
{% endif %}

FAQ from an ACF repeater

A repeater arrives as a JSON array:

[
  {"question": "How does it work?", "answer": "..."},
  {"question": "What are the benefits?", "answer": "..."}
]
{% assign faqs = article.metafields.wash_acf.faq_items.value %}
{% if faqs %}
  <div class="faq-section">
    {% for faq in faqs %}
      <h4>{{ faq.question }}</h4>
      <p>{{ faq.answer }}</p>
    {% endfor %}
  </div>
{% endif %}

SEO fields

{% if article.metafields.wash_seo.meta_description %}
  <meta name="description" content="{{ article.metafields.wash_seo.meta_description | escape }}">
{% endif %}

Translations

When a blog-mapping rule sends translations into Shopify Markets, translated custom fields and SEO fields are registered as translations of the same metafields.

Importing from Shopify

Import from Shopify can bring metafields back as custom fields. Fields in Wash's own namespaces come back under their original names.

Troubleshooting

The Meta Fields tab says metafield sync is disabled

Tick Sync Metafields on the Sync Settings tab and save.

A field isn't in the list

  • Click Refresh Fields after adding the field to at least one post
  • Fields starting with an underscore are skipped
  • For ACF, check the plugin is active and the field group is assigned to posts

A field doesn't show up in Shopify

  • Check its Sync switch is on
  • Check the post has a value for it
  • Sync the post again. Existing articles only change when they're synced
  • In your theme, use the namespace from the table above (wash_custom, not wash)