Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Maximum characters in metafield

Maximum characters in metafield

Zac12
Shopify Partner
65 0 20

Howdy,

What is the maximum number of characters in a metafield?

I've read previously that the limit was 65,535 characters.

 

Can we get some verification of this from Shopify?

Zyber Developer | https://apps.shopify.com/trademe | https://apps.shopify.com/productfilter | https://apps.shopify.com/splittest
Replies 3 (3)

Jason
Shopify Partner
11206 226 2315

Hey Zac -

Yes, that is the limit for a single metafields value. You can push a string larger than this but it will be truncated. If you need to store much more than this you might need to look at splitting it among multiple metafields.

Curious - what data are you storing that would need more than 65535 chars?

★ I jump on these forums in my free time to help and share some insights. Not looking to be hired, and not looking for work. http://freakdesign.com.au ★

Zac12
Shopify Partner
65 0 20

Heya Jason, got this all working in an alternative method.

But product data, funnily enough. Loading information via Shopify directly didn't give us the specific information we needed without doing multiple calls to get a complete record - and that started getting large.

We ended up throwing our cut down data into a JSON array and storing it in the theme's assets.

Zyber Developer | https://apps.shopify.com/trademe | https://apps.shopify.com/productfilter | https://apps.shopify.com/splittest

Jason
Shopify Partner
11206 226 2315

For massive slabs of JSON that's a far more sensible idea.
Glad to hear you've got a working model.

★ I jump on these forums in my free time to help and share some insights. Not looking to be hired, and not looking for work. http://freakdesign.com.au ★