I have a WordPress website which uses ACF (Advanced Custom Fields). I have 2 custom select fields which allow a user to be selected on posts - these fields are called 'Author' and 'Editor'.
The site has around 5000 posts and, for some of the older posts on the site, the custom 'Author' and 'Editor' fields are not being pulled through to the frontend of the site even though the custom fields appear to be set correctly within the post editor screen.
If I go in to an individual post and re-save/update it, then the custom fields appear to then work fine and are pulled through to the frontend of the site. Unfortunately, bulk editing the posts and re-saving/updating them doesn't appear to have the same effect of fixing the posts. As I have 5000 posts it's not really viable to re-save/update each one individually.
Update: I had already tried the instructions in the link provided in the comments from Stender - it doesn't appear to update the ACF fields data in the same way as manually updating a single post. Does something different happen during the manual method as opposed to using wp_update_post()?
Does anyone have any ideas on how I can fix the posts where the custom fields aren't being pulled through to the frontend in bulk?
If you need any more information or have any questions, please feel free to ask.