Change meta field content type after creating

Hey guys, I created a bunch of meta fields that are all working as expected, however, for one of them I accidentally created it as a text field single line rather than text field multi-line.

I really don’t want to create a new one, reorder it and copy the text into the new one from all my products, is there a way to change this in the backend so it automatically updates to a multi-line text field?

Thanks

Rosalind.

Hi Olivia,

Sasha here from Metafields Guru team.

The bad news is that it’s not possible to change a metafield type as there is no such method in the Shopify API (neither REST nor GraphQL).

The good news is that this is one of the most common problems solved with our awesome app.

And, of course, I’ll gladly share the details with you. Here’s are the plan that has already helped a bunch of Shopify merchants to change the metafield types in bulk:

  1. Export existing metafields into a csv spreadsheet. You can do that by specifying the namespace/key combination for a data export as shown in our step-by-step tutorial. This step gives you both a backup file and a source file to populate updated metafields later on.
  2. Delete existing (old single-line version) metafields using the bulk editor.
  3. Create a copy of a CSV spreadsheet from the item #1 (so that you can keep an original one as a backup file) , open it with the preferred spreadsheet editor and change the metafield type in bulk. Once you’re done, save the changes.
  4. Use the updated version of your CSV spreadsheet to populate the multi-line text metafields with the data import feature of our app.

And here’s a little advice from me: when you’re ready to start the data import, you may want to run a smaller import to see if the data was mapped correctly and make sure that main/full/big import goes smoothly. At the same time, you’ll be able to make sure that these metafields won’t be rejected by the Shopify metafield definitions (if you use any). Sometimes they might be giving merchants a hard time, so it’s definitely worth checking.

Let me know if you have any additional questions!

Best regards,

Sasha Kachkovskyi

Co-founder and CEO

256 Development

2 Likes

Relevant thread: https://community.shopify.com/c/technical-q-a/is-it-possible-to-change-a-metafield-type-from-integer-to-text/td-p/1372450

Thanks @Mts0001 this was a quick and easy solution.