Home › Forums › General Issues › Fields Not Saving
Had an issue with fields not saving. This only happened on the homepage of the site, which is controlled by a template.
Initially I had the template saved as homepage.php, with a header that allowed me to use the template by choosing it within the page template option in the WP admin. I then changed the file to front-page.php so WordPress would recognize it automatically. I believe this is where my problem began.
I could not edit any of the existing fields. I tried deleting text, deleting the fields, recreating the fields. Nothing worked.
I went as far as to delete the database entries… it still did not work.
Finally, I re-uploaded homepage.php, deleted front-page.php and they saved. I went back and selected “default template” from the WP admin dropdown (instead of the aforemention named “homepage” which used homepage.php) and after changing back to front-page.php, everything works ok.
Appears the problem may arise if you remove a template file without telling WP before deleting the template via FTP or similar.
I hope this information helps someone, as it took me awhile to figure it out.
Hi @jkuzma
Thanks for the info.
Can you confirm that when you edited a page in the backend, the fields would not update in the backend?
If the issue was only on the front end, perhaps there was some caching going on? Or perhaps ACF was loading the data from a different source than the page you were editing…
Thanks
E
Yes, the posts were being edited on the backend only. Upon a publish/update, the information was retained from the previous save and would not update (back or frontend.)
We were having this exact same issue for the last few days and it was getting extremely frustrating as things broke four days before our client site’s go-live.
I read through all the other similar thread (ie. ‘field not saving data’) and tried the max_input_vars and memory limit fixes, to no avail.
And then I bumped into @jkuzmas post and realized our problems has started right after we decided to stop using the admin’s template selection meta-box, but reverted back to only PHP based templating (like we’ve always done in previous projects, hence why we’ve never seen this problem before).
So basically the problem was that the meta field _wp_page_template was set for a page, but the template didn’t exist anymore. Clear it empty, or better yet, fill it with the default phrase ‘default’, and everything works again.
We suspect this has something to do with ACF’s location rules checks.
I’m having the same issue, I believe. I’ve added custom fields to a home page using the default front-page.php as a template. I can add data to the fields, but the data won’t save.
I set the page to a named page template, and the problem was solved.
Update: I removed the named page template, removed the front-page template and reset to default. I could save new data and display with the now default page.php. But here’s where it gets weird… for the heck of it, I put the front-page template back in the direct, re-entered and saved new data… and it worked.
The topic ‘Fields Not Saving’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.