Support

Account

Home Forums Backend Issues (wp-admin) Empty ACF values in wp-admin Reply To: Empty ACF values in wp-admin

  • The problem is that the values are stored in the wrong place, associated with a post instead of a term. Because WPAI was used for the import the fields have the correct key associations. So the first reply, while it can cause issues is not really the problem.

    What you would need to do to correct the situation using the data as it exists.

    1) Get all of the products
    2) Figure out what product category these values were supposed to be applied to
    3) Get these fields from the product
    4) update the field using the correct term id "term_{$term->term_id}"

    The problem here is going to be figuring out #2.
    – What categories is the product assigned to?
    – Is there more than one category?
    – Where the values imported to posts more than one time, i.e. where the same values added to multiple posts in the category?
    – If the product is in multiple categories then which category were the values really meant for?

    Because of these questions, and the additional questions that the answers would probably create, it’s really hard to give any meaningful way to resolve the problem.

    If this was me I would create a field group for the categories and then I’d create to proper import to import these meta values to the categories and I would just ignore the data that was created in the wrong way…. or find an way to just delete it all from the database, rather than try to transform the data that is stored improperly.