We had a third party transfer our FAQ to a new theme for Shopify 2.0 but when they did so they set up our FAQ with the answers set to “multi-line text” rather than “rich text.”
As a result we can’t URL links in our FAQ answers, so we need to switch them all to rich text to correct the issue. Unfortunately we didn’t pick up on the mistake until long after it was done so it’s too late to ask the third party to correct the issue.
It seems that changing a metafield from one type to another is not possible. Regardless we do need to fix this issue somehow without losing all of our FAQ answers in the process.
When I go to delete the current faq.answer metafield I get a pop-up warning me that “This can’t be undone. This will delete any content associated with this field that’s published in your store or other channels.”
As a result I’m afraid to delete the metafield and create a new one based on rich text, and then reassign all the unassigned meta objects as I’m not sure that the meta objects will even be retained, and I’m not sure how the process of assigning them goes. Do I need to delete both the FAQ answer and FAQ question metafields? Do FAQ answers stay paired?
Has anyone else ever done this and if so can you please provide the process?
G’day Andrew!
That is a bummer mate. Seems like a bit of an oversight by your previous developer!
If you delete the metafield, you will loose the data, so don’t do that. How much data is involved? Is it something you could copy across yourself?
If I was in your shoes, I would:
- Create a new richtext metafield (say rich_faqanswer)
- Copy data from previous metafield to rich_faqanswer
- Once all data is within new metafield, associate new metafield with the section from with the theme editor (Sales channels > Online Store > Customize)
Hopefully your previous developer used dynamic source rather than hard coding the value… Would be worth checking step 3 first to make sure its setup correctly.
Let me know if that helps!
1 Like
If I’m recalling right the rich_text_field type may have came later after the type system and metafield definitions were added but the changelog isn’t a good record keeper.
To convert them setup a new metafield or metafield definition and use an app to convert them shuffling the data around to a new namespace and key*.
- an ETL app like matrixify or ez-exporter to use spreadsheets
- find a metafield apps with conversion features
- or custom code in a scriptable app like usemechanic (unrelated mf examples)
*Or a temporary namespace and key to allow deleting the original to then recreate it to be of the rich_text_field type; this way may preclude having to change theme settings.
Alternatively FAQ content may be better suited for the newer Metaobjects system , especially if:
- info is not connected to specific instances of objects(a product, a page,etc).
- or used for large sets of objects , i.e. all products in a specific collection.
- content is frequently updated.
https://help.shopify.com/en/manual/custom-data/metaobjects
https://help.shopify.com/en/manual/custom-data/metaobjects/using-metaobjects
Good Hunting.
1 Like
Thank you for the insights Glenn. So if I’m understanding you correctly, I should:
-
Create the new Rich Text metafield as a third metafield (in addition to the current Question and Answer metafields)
-
Copy and paste the metaobject data from each Answer into the new Rich Text version
-
Delete the old Answer metafield
-
Re-assign the new Rich text metafield from the Theme Editor at the FAQ page
The issue I see with this method is that the FAQ page template requires that the Answers metafield be assigned the type name “faq” in order to be properly referenced in the code. I can’t actually use this name since it’s already in use by the current multi-line text metafield.
So in essence it seems that I would have to copy/paste all the FAQ answers into new meta-objects, delete the old Answers metafield, create a new metafield with the “faq” type name, then copy and paste them all again (since the type name field isn’t editable).
I may be using sloppy language to describe things, but it sounds like that would be my required path, which would be a real pain, hah.
Thank you Paul. I will reach out to various app support emails and ask each one if their app can handle this specific use case.
My fear is that I download an app and then when I uninstall it everything reverts back to the way it was to punish me for uninstalling it. I don’t really need a paid metafield bulk editor app for anything but a quick one-off usage.
Well for anyone curious I installed metafields guru and it doesn’t have the ability to mass edit custom metaobjects (which is what the FAQ uses) so I installed, paid to upgrade, and threw it out.
To clarify your post indicated only metafields being used currently.
metafields and metaobjects are very different avoid mixing terms.
Metaobjects are a new feature and afaik there is no tool that can convert arbitrary metafields to the new metaobjects feature out of the box.
1 Like
Glenn’s original solution ended up working. I didn’t have to delete the original Answers field, I was able to create a new one, copy and paste every FAQ answer one by one, save each, and then go into the custom editor and reference the new Answer as a dynamic source.
One small hiccup was that I had to delete all the paragraph breaks in all Answers and retype them in the rich text field to get them to register. A minor inconvenience.
I then had to go to each product page (default and custom pages) and update the FAQ dynamic source references in all of those. And now it all works.
2 Likes
Yes I’m sure I used a lot of sloppy language. Meta this meta that dynamic something. That metaobjects have their own fields is what threw me off, I was calling the metaobject fields metafields. Ah well. It’s all fixed now.
@Andrew222 Addendum, while there will be a learning curve for some object types it may be possible to use shopify-flow to do the data transfer part if you’ve already setup the metafields and want to avoid either manual data entry for hundreds+ of products , or needing third party app.
See flows metafield actions
https://help.shopify.com/en/manual/shopify-flow/reference/actions of the update_X_metafield variety.
Note only some object types are in flow(collections,companies,customers,draft-ordesr,products,product-variants,orders,shop), others like pages for an online stores /pages urls are not in flow. Further flow does not support metaobjects directly* at this time.
*may be possible through very advance usage of the send-http-request action to manipulate metaobjets.