Post Pic

WordPress tip: Create invisible custom fields

Existing Custom fields are visible and editables when you edit a post. But when the custom field is created by a piece of code, you may not want to display it publicly. Here is how to do.

This little trick is extremely simple: All you have to do is give a name starting with an underscore to your custom field when you create it, and it will not be displayed on WordPress dashboard when editing a post, as shown in the example below:

add_post_meta($id, '_name', 'value');

Easy, isn't it? And of course, very useful :)

Thanks to my friend John Kolbert for the tip!

Leave a Comment

* Name, Email, Comment are Required