Support

Account

Home Forums General Issues Site Redesign – Maintain ACF's Reply To: Site Redesign – Maintain ACF's

  • K, I was asking because there is quite a difference between how term content (categories) and post content (pages) is saved in ACF.

    Basically, all of the acf fields are saves as custom fields in the postmeta table and each field has several values in the database.

    The important field would be the post_id field in the database. If you wanted to move all of the field groups from all of the sub pages to the parent page without loosing the data you would need to change all of the references from the child post_id to the parent post_id, You would also need to attach the field groups to the correct page template being used.

    The steps involved would be

    • Alter the field group and change the location rules to the same as the field groups on the parent page
    • Get the ID values of both the parent and child page
    • Edit all of the postmeta rows involved to change the child page post_id to the parent page post_id

    If you have phpMyAdmin the last part could be accomplished by doing the query
    UPDATE wp_postmeta SET post_id = 'PARENT ID' WHERE post_id = 'CHILD ID'

    The above assumes that the table uses the standard WP table name and you would insert the actual post_id values where is says PARENT ID and CHILD ID

    While this could still be potentially time consuming, it would likely take less time than updating all that data by hand.

    Once all the data is updated you can safely delete the child pages.

    Make sure you back up your database, just in case.