0

I have multiple meta boxes for my Custom Post Type posts.

I want my users to add new fields using Custom Fields. The problem is - Custom Fields display all the garbage from my metaboxes and it might be very confusing for users.

Here's a screenshot, the two first fields were added by an user and the rest comes from the theme itself (there are metaboxes above this "Custom Fields" box which use / reset these fields on post save). How do I hide them?

2
  • I, personally dislike WordPress' default Custom Field design. Why not incorporate a good plugin like "Advanced Custom Fields" (ACF) or "Extra Fields"? With my ACF experience I can say, you can choose what CFs will be visible and in that post type what other meta boxes will be visible too. Dec 3, 2013 at 1:07
  • I know, but I don't want to use any plugins, this default Custom Field design is good enough and have all the features I need, the only problem is I have absolutely no idea how to work this issue out... Also I just want to know the answer (and I hope there is one, if not then Custom Fields seem useless to me), and I wouldn't learn anything new using plugin :) Thanks a lot anyway! Dec 3, 2013 at 1:48

1 Answer 1

1

Prefix all meta data keys used in meta boxes with an underscore, this will hide them automatically from the built in Custom Fields interface.

So instead of:

themeprefix_source

Use:

_themeprefix_source
1
  • Neat! Is this somewhere in documentation? Dec 8, 2013 at 16:06

Your Answer

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

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