Home Forums ACF PRO ACF Field Data Disappears


ACF Field Data Disappears

  • We have a problem that randomly happens. The client is so upset he wants to move away from WordPress completely. I have a simple Fieled Group with 5 text fields and one WYSIWYG Editor field, set to show if Post Type = Post. Four posts are created every evening and scheduled to be posted early the next morning. Seemingly randomly one of the posts will have missing content from the ACF fields but the rest of the post is fine. The client is adamant that he saves multiple times while creating the posts and previews all the posts as well. But if I go in to look at a post that publishes with missing ACF data, and look at post revisions the data in the custom fields will be missing from the revisions as well. I’m not seeing anything in the error logs. I have tried everything I can think of and can’t figure out why this happens. I haven’t been able to replicate it either. It’s happened twice in the past 5 days, previously it had been six weeks since this occurred.

    I’m at a loss. Any ideas on how to troubleshoot this?

  • For anyone else that runs into this issue. It appears to be a bug. I have been able to replicate it on two sites and will test it on more sites soon. It happens under the following conditions.

    If a post with ACF fields is scheduled, and the scheduled post is then edited and any content is changed in the fields OR the main content area, whether the post is saved or not before clicking the preview button at the top of the window and selecting “Preview in new tab”, any custom field content will be gone in the preview. If you go directly from the preview window back to the All Posts page and preview the post from there the content in the fields will be gone. However, if you left the original edit tab open the fields will be there and you can re-save the post. If you then click the “View Post” link that briefly appears at the bottom of the window, the field content will be there.

  • Here is a screen recording showing the issue

  • Have you submitted this to the developers? If you have not you should because they don’t watch this forum. You can contact them with this form or submit a ticket when logged into your account.

  • Yes, I have submitted a ticket. They acknowledge that there is a bug:

    Unfortunately the issue with the preview appears to be related to a known bug with ACF and the WordPress block editor. The same issue can happen when previewing fields in an already published post. This is something that we’re planning to fix up in a future release.

    In either case, the custom fields should show up in the frontend once the post has been published.

    But they don’t think this could be the cause of custom field data not showing up on the frontend after scheduled posts are published.

  • An explanation of why preview does not work with ACF fields.

    WP does not go through the same process when you click on preview. None of the custom fields are submitted. This causes WP to store a draft of just the stuff that is native to WP. This works the same way as WP Auto Save. In fact, clicking on preview actually calls WP Autosave. WP is temporarily storing a draft of the content and those things that are native to WP and it is ignoring all the custom fields.

    This is the case no matter what the status of the post is. If you edit the ACF fields for a published post and click on preview before updating the post you will see the previous values of the ACF fields will be shown and not the current values.

    The only reason that I can see that the content of ACF fields would be missing completely is if the previous save of the post had no content in those fields. So, they scheduled a post before entering content there and then they entered data and then clicked on preview before clicking on update or never clicked update. And from what you’re telling me basically when using guberbug is that the default is to not open the preview in a new window so it makes perfect sense to me why the content would disappear, because the content was never saved. I did not know this, I do not create sites that use the “New Editor”. It is a poor assumption on the part of the WP/guberbug developers to assume that users are only going to use that editor for all content.

    In any case the “Preview” feature in WP is completely worthless when using custom fields and this is the case with ACF, native WP custom fields, or any other plugin that creates custom fields. This has always been the case. A post must always be saved before clicking preview to see updated custom field content, whether it is opened in a new window or not.

    I don’t see how ACF can hope to fix this unless they replace the WP autosave with something that does not completely ignore everything that is not native to WP or perhaps a second script that is run when preview is clicked that does the same thing that is done by autosave but for ACF fields.

  • Thank you for this.

    The user swears he always saves the post before previewing.

  • Over six months and several ACF Pro and WordPress version upgrades later we are still struggling with this issue. We have a ton of posts with custom field data. I’m beyond frustrated with this problem.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.