Skip Navigation

[Resolved] Remove prefix when adding new custom field

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.

This thread is resolved. Here is a description of the problem and solution.

Problem:
Is it possible to alter the

WPCF_META_PREFIX

(the constant that stores the

wpcf-

prefix for Custom Fields in Types)?

Is it possible to change that so no prefix is saved, or a custom prefix is used?

Solution:
No, it is not possible and will cause issues as seen here:
https://toolset.com/forums/topic/update-3-0-breaks-custom-archive-templates-shortcodes/

Any modification made to

WPCF_META_PREFIX

are not suggested and not supported.
Issues surging from it are not assumed a BUG.
There is no possibility to change the

wpcf-

prefix, if you want that, please submit is a Feature Request.

This support ticket is created 9 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 replies, has 2 voices.

Last updated by timothyC-2 9 years, 6 months ago.

Assisted by: Beda.

Author
Posts
#250394

How can I make Types not add the wpcf- prefix when I add a new custom field? I have existing data to load and being unable to change this is annoying.

#250555

Dear Timothy,
Types internally will automatically add wpcf-prefix when adding a new field. This is by design and could not be removed. This way, the plugin can isolate and control its own sets of fields. This will effectively prevent issues when mixing with other custom fields not created with Types and coming from other plugins or themes.
Can you please elaborate more on your problem on loading existing data? Why you need the prefix to be removed? You can always retrieve the values of Types custom fields created using our Types Field API: https://toolset.com/documentation/functions/ without needing to worry about these prefixes.
If you can describe the problem in details with some screenshots. That would help a lot. Maybe a solution exist which will not require removing of the Types field wpcf- prefix. Please let me know how it goes. Thanks 🙂

Cheers,
Emerson

#250557

I need them removed because I am applying my own prefix. I am migrating from hard-coded types and I need this functionality for fields not yet defined during migration.

There are too many data that relies on the old names and it is not really an option to migrate everything to the new names. Having some data use the old prefix and some the new one would cause confusion for other devs.

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.