Hello,
We have multiple websites and sometimes we need to import posts from one site to another instead of recreating them.
We have created a post importer plugin and imported the posts.
everything works fine except the ACF image field images are not getting imported, if we added the image in a WYSIWYG block, it’s coming through.
but only the image field shows empty and also nothing gets imported to the media library as well.
Do we need to do any extra mapping for the images to be imported and added to the field?
Image fields stores ID values form images. Any export would need to convert these to URL and then on the import you would have to use media_sideload_image() to import the image into the DB and get a new ID for it and then update the field with that new ID.
Thank john for the insight, is there any example snippet on how to convert these to URL?
This would have to be done during the export to convert the ID to a URL to allow the file to be imported, so would depend on what you’re using to export.
This reply has been marked as private.
I don’t know what a “post puller extension” means. Is this a plugin?
This reply has been marked as private.
If this “puller” is using the rest api then look at the acf setting “rest_api_format” on the site the post is being pulled from.