WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a custom meta box to handle certain custom post meta fields and I don't want the clutter of having these custom fields duplicated down in the "Custom Fields" area.

How can I remove specific custom post meta from the "Custom Fields" fieldset?

share|improve this question
up vote 0 down vote accepted

To hide a custom field from the "Custom Fields" section, prefix it with an underscore. So add_post_meta($id, 'name', 'value'); becomes add_post_meta($id, '_name', 'value');.

Here's a good reference for backup:

share|improve this answer

You can hook into the is_protected_meta filter and return true for any custom field you want to hide.

add_filter('is_protected_meta', 'my_is_protected_meta_filter', 10, 2);
function my_is_protected_meta_filter($protected, $meta_key) {
    return $meta_key == 'meta-name' ? true : $protected;
share|improve this answer
Clean up your code please. Use the {} sign above the editor to add code in a code block. Thank you – Pieter Goosen Jul 21 '15 at 11:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.