Home › Forums › General Issues › Exporting/Importing – how to maintain the same id's › Reply To: Exporting/Importing – how to maintain the same id's
When I do imports I use WP All Import Pro (WPAI). This plugin has an add of for ACF. The updating feature. It can look for existing posts, terms, etc. They also have an export plugin. But it can take extra coding to use the export plugin.
The issue is that ACF stores ID values. This can be an issue with terms. Every import plugin that I know of works on the term name and not the term ID.
There are a couple of ways around this. For example using WPAI you can create a function on the import that can take the ID and convert it to an existing term name for the import plugin to use. But there is no capability in the plugin to actually update the term name of anything else related to the term.
You’re going to find that this is an issue with most import plugins. As far as I know there aren’t any import plugins that will do what you want to do without a bit of work. They all work with posts and do not do a great job with taxonomy terms unless you write code. I use WPAI because they provide a set of hooks that allow me to run custom code as well as run imported values through functions before they are imported.
Expanding on what I said. I would export and in the export I would have 2 columns. One that contains the term ID and a second that contains the term name. For the import I would import these to columns into custom fields in the post. WPAI has an action hook that runs after the post is imported. On this hook I would get the term ID value and the term name value and update the term myself.
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!