Hi,
another admin on my website created a WYSIWYG editor custom field to use it in a usage that only requires a single line text custom field.
He then used it on multiple posts.
I want to correct this and use a single line text field to make the backend lighter.
How to do so without losing the data already filled in? when i try to change its type, i get all other types greyed out.
Thanks.
Hello,
Yes, it is expected result, you can not change the WYSIWYG custom field to other field type, as you mentioned above:
get all other types greyed out
So there isn't such a built-in feature within Toolset Types plugin.
However, you can try these to migrate it to another single line field with SQL query:
For example there is a custom WYSIWYG field "test-wy" in your website, you can migrate it to another single line field "test-s1" using below SQL query with some Mysql tools, for example PHPmyadmin:
update wp_postmeta set meta_key = 'wpcf-test-s1' where meta_key = 'wpcf-test-wy'
Please replace "wp_" with your WordPress database prefix and backup your website database first.
Thanks a lot Luo,
my database prefix is "wp_".
i changed the current slug of the custom field to: "toc-title-old", and created a new custom field, with a slug: "toc-title".
then ran this query:
update wp_postmeta set meta_key = 'toc-title' where meta_key = 'toc-title-old'
However, it returned with 0 rows affected, and nothing changed.
what mistake I am doing?
thanks
the correct code is to add "wpcf" first, as per the supporter's reply:
update wp_postmeta set meta_key = 'wpcf-toc-title' where meta_key = 'wpcf-toc-title-old'