Skip Navigation

[Resolved] How to change a WYSIWYG editor custom field to a single line custom field?

This support ticket is created 4 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by AtefR7377 4 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1401353

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.

#1401435

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.

#1402015

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

#1402133

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'