Home › Forums › General Issues › Not save empty fields in database › Reply To: Not save empty fields in database
There is nothing built into ACF that will do this. However, you could modify what ACF is doing by removing empty values from the input. You could create an acf/save_post filter that runs on priority 1 (before acf) and filter $_POST[‘acf’] to remove any empty values. But there would be an issue with this, for example, what if a field had a value previously and not does not have a value. You’d also need to check for existing values in fields that are empty when submitted but used to have a value and then delete the existing value yourself.
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.