I have 3-4 custom post types in my wordpress site. Each one has some unique post meta fields I create and update using meta boxes.

In looking in the database during development I'm noticing that every post meta field being used for all custom types is being added for every time I add a post regardless of post type.

So if i add a "Team" post type, it adds a row for every meta field for Team custom post type and all the meta fields for the Person custom post type as well (the person ones have blank values but it's still taking up rows in the database).

Why is this happening? I'd rather prevent the excess rows since I'm going to have a large amount of data.

  • 1
    What's your code? Apr 3, 2014 at 14:54
  • 2
    Please post the function that you're hooking onto the post saving that saves the meta data. Apr 3, 2014 at 15:01
  • I guess an if can solve your problem, without seing your code is impossible to say where this if goes..
    – gmazzap
    Apr 3, 2014 at 15:17


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.