I’ve imported some content with custom fields from an older WordPress site.
The custom fields are not created with ACF, but I would like to use ACF moving forward from this point on.
What would be the best option to convert the current custom fields to advanced custom fields?
Any ideas/suggestions are very welcome.
If you set the field names of the fields when setting up ACF to the name of the current custom field ACF will pick up the values the next time the post is edited.
If you want to set them all to be picked up without editing each post then that’s a bit more work. Each field in ACF has two entries in the postmeta table.
Let’s say that your field name is represented by $fieldname. The two custom fields that need to be saved are
$fieldname = your value
‘_’.$fieldname = acf field key
Hello. I need to do the same as the OP. And I need to do it without editing each post. There are 364 of them. How can I update the two entries in the postmeta table automatically? Or could I use a database field mapping plugin or import plugin that would do such a thing?
Thanks for any insight!
Sorry for the late reply, this is a very old topic.
There isn’t any way to retroactively do this.
All I can say is this. If the fields are basic fields that store only text data then creating a field group and fields with the same names will make everything work. ACF will automatically pick up these fields.
If the field data is stored some other way, examples
then this information cannot be converted without a lot of effort. You’d need to create some kind of a cron that would read through every post and read every one of the existing fields and then update the database and all fields to what ACF needs in the database. To be honest, doing this is not realistic.
Another alternative might be to use WP All Export Pro and WP All Import Pro. It might be possible to export the content to an XML file of spreadsheet and then import and rearrange the data. This is probably the path I would try. http://www.wpallimport.com/
I hope you can help me: ACF does not pick up the field names automatically.
I’ve created ACF fields with identical names to my core wp fields. They are all text fields. I have set the field group to “product”, as they are all WooCommerce products.
However, even if I save the posts, the ACF fields do not update. I’m using version 5.8.7.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!