Is there a way to change field names but keep the data in them?
I have repeater field that I named events. I already put a lot of data into the rows and now need to change the name of the field. When i changed the name of this field, all the data disappeared from the post. Can i re-associate the data somehow?
You would need to go into the database and change all occurrences of
old_field_name to new_field_name
_old_field_name to _new_field_name
If the fields are sub field of a repeater or a flexible content field it becomes more complicated. If they fields are in the options table for options pages or taxonomies, that would be more complicated as well. You’d first need to figure out what you need to change.
This could cause problems if you have other fields in other field groups with the same field name.
No, there isn’t any easy way to do this. There’s noting in ACF that will do it and there are too many variables involved when dealing with a repeater field. Is there some specific reason why the field needs to be changed? Is it conflicting with another field or another plugin?
Viewing 4 posts - 1 through 4 (of 4 total)
The topic ‘changing fieldnames, keeping data’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users