Many plugins use custom fields to store data about individual posts. When a plugin adds a custom fields, its key and value (or name and value) are listed in the Custom Fields meta box. For instance, a syntax hilighting plugin may set a custom field syntax_enabled on posts that use the syntax highlighting CSS.
Often the user doesn’t need to see this information and it can leed to needless confusion. Unless the user needs to edit these custm field values there’s really no need to have them listed here.
How to Hide Custom Fields
Custom fields can be hidden from the Custom Fields meta box quite easily. Typically custom fields are added by using the following code:
add_post_meta($id, 'name', 'value');
To hide your custom field from user view, simply start the name of your custom field with and underscore (“_”). So create your custom field like this:
add_post_meta($id, '_name', 'value');
Your custom field is now hidden!
This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.
Oren Yomtov said:
If you need to change lots of custom fields you can use my plugin to do it.
on May 23, 2009 at 1:08 am
Peter said:
I couldn’t agree more John – more plugins (I’m looking at you, all in one seo pack) should absolutely take advantage of this. Having the information displayed in 2 places only causes confusion.
on May 23, 2009 at 10:47 am
The Frosty @WPCult said:
I am going to agree with you on this one.
on May 26, 2009 at 1:46 pm
Freelance Jobs said:
This is what I looking for, thanks
on July 12, 2009 at 10:26 pm
Andrea said:
i am actually just starting to learn wordpress, i know somebody who just got into using wordpress, he's actually a programmer that recently started with wordpress… he told me how great it is and that i can do it too as it's fairly easy to use… that's why i'm going around looking for things to learn.. thanks for this, i'm positive we'll benefit from this…
on September 10, 2009 at 10:52 pm
Car hire Belfast said:
I have worked with Joomla. Could anyone tell me which tool is better – Wordpress or Joomla? I like Joomla and it is quite easy to work with Joomla. Wordpress looks a little bit more complicated, isn't it?
on November 19, 2009 at 9:59 am
@rarepearldesign said:
thanks for this information, this cleaned up my ui quite a bit!
on January 25, 2010 at 2:31 pm
car hire munich said:
finally I have found what I am looking for! thanx!
on February 12, 2010 at 12:56 pm
Reino said:
But how about field that are allready submitted, is there a way to hide them using the underscore method
?
on February 17, 2010 at 4:07 pm