When you use a standard custom field in WP you have to write the name of the cusotm fields the first time.
The second time you use a custom field it sticks to the custom fields dropdown list. But, sometimes when you install plugins they ise ALOT of custom fields.
This list becomes a bit long an it may “push” som of my custom fields out of tghe list. So, does anyone know how I can remove custom fields from my dropdown list in any easy way?
You can filter the query for these keys on
'query'
. I would start that filter as late as possible to avoid side effect.Sample code, tested:
There isn’t a way to filter what appears there, you can see where it queries for keys and renders that field in the function
meta_form()
inwp-admin/includes/template.php
, however you can see that it ignores any key prefixed with an underscore:this is what plugins should be doing with any meta keys they create to hide those keys from the menu.
You’ll also see a filter in there,
postmeta_form_limit
, which is set to 30 by default. You could increase this number so your keys at least get included in the list and don’t fall off the end.Another option is to create your own meta box to manage specific meta data, rather than using the Custom Fields meta box.