Home › Forums › ACF PRO › Updating existing fields › Reply To: Updating existing fields
There really isn’t an efficient way to add values retroactively to existing posts… other than edit and update every post where the new fields are used.
The best way to deal with adding new fields is to assume a default value in your code when they are not set.
Simple example:
$value = get_field('my-field');
if (!$value) {
$value = 'default value';
}
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.