Metafield key with special character: how to access via liquid?

1 0 0



I have a metafield with a "/" character in key name. Everything is ok accessing it via REST but how to access it via liquid? 

{"key":"A/C","value": "A/C", "type":"string","namespace":"global"}
nothing works
Reply 1 (1)

Shopify Staff
2731 301 779

Hi Ios14,


It's not possible to access a metafield via liquid if it contains a "/" character in the key name. This is due to the fact that the "/" character is treated as a path separator in Liquid and is not valid in variable names. It's recommended to avoid using special characters like "/" in metafield keys to ensure compatibility with all parts of Shopify's system, including Liquid.


You may need to rename your metafield key to something without the "/" character to be able to access it via Liquid. For example, you might change "A/C" to "AC" or "A_C". Then you would access it via Liquid, eg:

Please note that renaming the metafield key will require updating any existing data or code that references the old key name.


Hope this helps!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit or the Shopify Web Design and Development Blog