Let me hide my certain meta key from the edit-publish custom area area. Let us say I've meta key with title "test1". I'm not going that to become made an appearance on my small edit-publish/page. However, I still wish to show other custom fields,like let us say "test2" "test3" "test4" etc.

I have read something about remove_meta_box('postcustom','post','normal') however it hides my custom fields.

I additionally read about renaming your meta key with "_test1". Yes, it's hidden, the main problem happens since there is a wordpress plugin uses that meta key ("test1") too. So renaming the meta key begins with underscore is not recommended.

Can there be any code/function to cover certain custom fields? I'm not going customers to edit that "test1" custom area however they still can edit other custom fields.


You are able to hook in to the is_protected_meta filter and return true for just about any custom area you need 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 == 'test1' ? true : $protected;