Support Forum
Support › MB Custom Post Type › CPT Custom Fields Keep Disappearing
I have a client who I'm building a coaching site for. FYI, I'm using Bricks.
One of the CPTs I made is for her coaching courses. It's kind of a long page and I have about 30 custom fields so far in order to build it.
For some reason, the custom fields and all of the associated data keep disappearing. No reason... no updates, no duplications of field names, nothing. I have to keep spinning up backups of the site to get the CPT to work. This has been going on for like 2 weeks now.
For example, I was working on the site yesterday, building the course template using a single CPT as the data, and everything was fine. Then I opened the site up this morning... the template was empty. I check the CPT and the single course I entered was gone. I check the custom fields and all 30+ fields are gone.
So, I spin up a backup from yesterday and I am back in business. I keep working on it, adding more options to the course template, but NOT changing anything in the actual CPT. I leave my computer to heat up my lunch and 5 mins later sit back down to keep working. I refresh the page and everything is gone again.
I'm not sure what to do at this point. So far, it's only this ONE CPT that I am having issues with. Her books CPT, testimonials, FAQs, etc are all working fine. It's just the courses CPT.
I have done some research and have not seen this from anyone else. I did find a post about changing the value of PHPs max_input_vars on my server to 10000, which I did... but that obviously didn't solve the problem.
I hope someone can help me.
Hello Erik,
That means the created posts and field value in the admin area are removed automatically, is that right? Can you please share some screenshots of the issue?
You can copy your site to a staging site, then deactivate all plugins except Meta Box, MB extension plugins, switch to a standard theme and let me know how it goes.
I think I'm having the same issue.
If it matters, I created the CPT and Custom Fields using Metabox AIO. It built it out on Website A, where everything is working perfectly. I used the Meta Box export/import tool to move it to Website B.
On Website B, all of the fields are visible at first. But after filling them in and saving, the content is removed.
Interestingly, I have a webhook set up to auto-post from Website A to Website B and this actually works, initially. At first, the post displays properly on the front end. But, the post still breaks if you re-save (even if no edits were made.)
See this video from a staging site for Website B:
https://www.awesomescreenshot.com/video/24124078?key=558537a2a6e1378a46f36e2107dccf81
- Default theme
- Only activated plugins: Meta Box and Meta Box AIO
- Review CPT: Podcast
- Review Custom Fields: Podcast
- View Podcast post created by webhook - all fields properly filled in and saved
- Resave post without making any edits and refresh the page
- Result: Content is removed, custom fields are removed
The same is true if I create the post from scratch on this site.
If I add content to the fields and hit save, it *appears* to do so. But when refreshed, the same result occurs: content is removed, custom fields are removed.
I believe I'm seeing this issue too, it's a huge issue for me! I am trying to drag sub-groups out from the parent group to the root level (in other words I'm trying to remove a layer of grouping), and it seems to work for a bit if I save along the way, but eventually after refreshing the custom fields page a few times, it seems to go awry and I am missing fields or fields are suddenly in a different spot than they were when it was saved, causing me to be missing fields. This is unworkable at the moment for me, I'm stuck. Please resolve ASAP if possible. If I can do anything to help, let me know.
What appears to be the same issue is reported here too, recently (this definitely a Meta Box defect that needs to be resolved ASAP): https://support.metabox.io/topic/metabox-ui-disappeared-when-posting-new-or-editing-existing-post/?swcfpc=1#post-44222
Posting for cross-reference.
How do we downgrade a version? It seems I can't download older versions from the Meta Box Account page and this is preventing me from moving forward. I'd like to downgrade in the meantime to see if this fixes things assuming this was a defect added in one of the most recent releases.
@DustinD: Your issue looks different from other ones. The fields are removed from the field group. You may double-click on the Update button of the field group and the fields are lost. If the issue happens with other field groups, please share your site credentials here https://metabox.io/contact/
I will take a look.
Note: we do not support older versions of MB plugins.
@Kara: Please try to bypass the sanitization of the field and add only text to the field, save the post and check the issue again. Following the documentation https://docs.metabox.io/sanitization/
I've sent the contact details / URL login link, please confirm as soon as you can. Thank you.
Peter - that worked perfectly.
I assume that, as long as we trust the embed codes being used here, we shouldn't be concerned about turning off the sanitize feature?
For what it's worth, Website A does *not* bypass sanitization and it still works perfectly.
Same server and theme but a different plugin stack.
Thanks very much!