Home Forums General Issues stopping post_meta wordpress table underscore files from being created


stopping post_meta wordpress table underscore files from being created

  • Hi All,

    Hopefully someone can help me!

    My query is regarding advanced custom fields, and the duplication of data in the database whenever a new field is added onto a post.

    Say for example I have a ‘Surname’ custom field against a post, which allows me to store a surname value as a custom field. I enter the value and save.

    When this is saved and the row for surname is added to the wp_postmeta table it adds the meta_key ‘surname’ with the value of the surname entered. However, it also adds another row to this table with the meta_key “_surname” with an example value of “field_5475fd80a8d2e”.

    This occurs for every single ACF entry onto a post and say I have 30 custom fields on a post, this would add 60 records to the database wp_postmeta table, which I feel is unnecessary.

    Does anyone know of a way to stop the meta_key rows beginning with ‘_’ from being created? I feel that they are clogging up the database and not bringing much to the party! If I add one via a website form to the database using the add_wp_meta function, it still works when I go into the post in wp-admin, so I can’t see why the _ files are required.

    Thanks for looking!

  • That extra field is the only way that ACF knows how to find your field data and what to do with it. Without that field you can’t use the functions in ACF to get the field data and format it the way it needs to be formatted.

    So the answer is no, you can’t do that.

  • Hi Hube2,

    Thanks for getting back to me, much appreciated. I will just go about business as usual.

    Thanks again!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘stopping post_meta wordpress table underscore files from being created’ is closed to new replies.