Support » Fixing WordPress » Custom field posting data to wrong database row

  • Resolved Brad


    I’m having an issue where either WordPress or MySQL is adding rows to posts in my wp_postmeta table that aren’t associated with those posts.

    For example, I have a custom field group that I created with the Advanced Custom Fields plugin titled Recipes. Within that field group are custom fields for Ingredients, Directions, Cook Time, Prep Time and Serving Size. Each field has a unique Field Key that posts to a wp_postmeta meta_key & meta_value in MySQL.

    Whenever I try to create a new Recipe post in the WP-Admin, some (not all) of the fields won’t publish to their intended meta_key in the database. Instead their data is posting to unrelated wp_postameta meta_key’s that are associated with a different plugin, Simple Maps. This is causing the data to not display on the website (or in the custom field inside the recipe post).

    I’ve tried deactivating all plugins and only reactivating Advanced Custom Fields but it didn’t fix it. I also tried switching to a default WordPress theme like twenty-thirteen and only reactivating ACF. That didn’t work. I even tried repairing the database tables. That didn’t work.

    What’s weird is that when I login to the phpMyAdmin and manually delete the Simple Map rows from the wp_postmeta table and go back to the Recipe post in the WP-Admin to update it, it adds those unrelated meta_key fields from Simple Maps back to the post in the wp_postmeta table again. Even when the Simple Maps plugin is deactivated.

    This only started happening recently. It used to not be an issue. I’ve been posting Recipes for years using Advanced Custom Fields along with the Simple Maps plugin installed.

    On a side note, Simple Maps does not share the same meta_key/meta_value or field key as the Recipe group. It’s also not affecting any other Field Groups in Advance Custom Fields. Only the Recipe group.

    Any idea of what’s triggering this or how I can fix it?

  • The topic ‘Custom field posting data to wrong database row’ is closed to new replies.