• I have an intermittent problem that has been driving me crazy. I have a simple field group of 6 custom fields tied to the post type “Post”. There are 4 text fields and one WYSIWYG field, none of the fields are set as required. The custom fields were set up using Advanced Custom Fields Pro. My client schedules four posts each evening to publish early the next morning (2:32 a.m., 2:33 a.m., 2:34 a.m., 2:35 a.m.). The client saves regularly while creating the post and also previews the posts. On occasion (this week more than usual) one of the posts will have missing custom field data, it’s just gone, not trace of it in the database nothing showing in post revisions and yet when the client previewed the post before and after scheduling the data was showing. It usually only happens on one out of the four daily posts. So far I can’t find a way to reliably recreate the issue.

    The folks at ACF Pro suggested there might be a cron job causing problems. I’m not running any special cron jobs just the default WP-cron. I have set the firewall scanner to run at a different time than when posts are scheduled. Switched backup plugins to be manually run, removed the caching plugin, disabled the caching at the server level (Bluehost), and also disabled caching in wp-config.

    Posts are done in the default Gutenberg editor.

    Any ideas on how to find out why this happens and how to fix it? The client is ready to leave WordPress completely out of frustration.

    Host: Bluehost
    WordPress Version: 6.3.1
    ACF Pro version: 6.2.1.1
    Theme Divi version: 4.22.2
    PHP version 8.1.23
    PHP memory limit: 512M
    PHP max input variables: 5000
    PHP time limit: 600
    Max input time: 1200

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter balex66

    (@balex66)

    I’m wondering if I should try disabling wp-cron in wp-config and run a cron job from my Bluehost Control Panel instead.

    • This reply was modified 1 year, 5 months ago by balex66.

    Hi and thanks for reaching out! It may be difficult to find the root cause of an issue such as this. As we are not WordPress developers, we will be a bit limited on how much support we can provide here, however, we would be happy to help as much as we can.

    You mentioned trying to run the cron job from the Bluehost cPanel and that is certainly worth attempting. You may also want to check the error logs in your site files. You would want to check these logs around the time that a post missing the field data is made to get the most relevant information. I will leave a link with more information on this below in case you need it. If you’re still not finding a resolution with that information, I would recommend working with a developer to determine the cause of the issue.

    https://www.bluehost[.]com/help/article/error-logs

    It is entirely possible that the situation like the one you are experiencing would require the assistance of a developer which would limit our support’s ability to assist. That being said, our team is always available and more then happy to look deeper into this matter in hopes of assisting or pointing you in the best possible direction.

    https://www.bluehost[.]com/contact

    Thread Starter balex66

    (@balex66)

    I have found a way to replicate the issue. I’ve only been able to trigger it by editing a scheduled post, then click the preview button at the top of the editor window, click preview in new tab none of the custom fields will show but any changes to the main content area will show in the preview. If a user then goes out of that window to posting a new post or back to the “All Posts” page in the dashboard, all of the ACF field data will be lost.

    However, if edits are made to a schduled post and then the blue “Schedule” button is clicked to save the edits and the “View Post” link that appears briefly at the bottom of the window is clicked all the content and changes are visible. If the changes are saved and then you go back out to All posts without previewing first, and then click “preview” under the scheduled post all the ACF fields and changes are saved.

    I’ve also verified that I have at least two sites so far where I can replicate this behavior. Both sites have custom field groups created with ACF Pro attached to the post type “Posts”

    • This reply was modified 1 year, 5 months ago by balex66.
    Thread Starter balex66

    (@balex66)

    Here is a screen recording of the issue.

    What is stranger still is sometimes we can’t even go back to a revision to get the field data restored, it’s like it was never entered even though multiple saves are being done while editing.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom Field Data Disappears when Post is Published’ is closed to new replies.