{"id":326,"date":"2013-10-31T00:00:42","date_gmt":"2013-10-31T00:00:42","guid":{"rendered":"http:\/\/pixert.com\/blog\/?p=326"},"modified":"2014-06-09T05:11:59","modified_gmt":"2014-06-09T05:11:59","slug":"wordpress-how-to-hide-custom-fields-meta-key-from-custom-fields-panel","status":"publish","type":"post","link":"https:\/\/pixert.com\/blog\/wordpress-how-to-hide-custom-fields-meta-key-from-custom-fields-panel\/","title":{"rendered":"WordPress: How to Hide Custom Field Meta Key from Custom Fields panel"},"content":{"rendered":"<p><a href=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"25\" data-permalink=\"https:\/\/pixert.com\/blog\/how-to-upgrade-wordpress\/wordpresslogo\/\" data-orig-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?fit=498%2C113&amp;ssl=1\" data-orig-size=\"498,113\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"WordPress &#8211; the logo\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?fit=300%2C68&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?fit=498%2C113&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=300%2C68\" alt=\"WordPress - the logo\" width=\"300\" height=\"68\" class=\"aligncenter size-medium wp-image-25\" srcset=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?resize=300%2C68&amp;ssl=1 300w, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo.png?w=498&amp;ssl=1 498w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nI learned this trick when someone asked about How to Hide Custom Fields Meta Key from Custom Fields panel. This trick useful when you want to hide certain Custom Fields Meta Key and Value from client or authors<br \/>\n<a href=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/10\/customfields.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"337\" data-permalink=\"https:\/\/pixert.com\/blog\/wordpress-how-to-hide-custom-fields-meta-key-from-custom-fields-panel\/customfields\/\" data-orig-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/10\/customfields.png?fit=810%2C300&amp;ssl=1\" data-orig-size=\"810,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"Custom Fields\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/10\/customfields.png?fit=300%2C111&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/10\/customfields.png?fit=810%2C300&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/10\/customfields-300x111.png?resize=300%2C111\" alt=\"Custom Fields\" width=\"300\" height=\"111\" class=\"aligncenter size-medium wp-image-337\" srcset=\"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/10\/customfields.png?resize=300%2C111&amp;ssl=1 300w, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/10\/customfields.png?w=810&amp;ssl=1 810w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nAdd following code to functions.php<\/p>\n<pre class=\"brush: php; title: Code Block; notranslate\" title=\"Code Block\">\r\nadd_filter('is_protected_meta', 'my_is_protected_meta_filter1', 10, 2);\r\nfunction my_is_protected_meta_filter1($protected, $meta_key) {\r\n    return $meta_key == 'mymetakey_no1' ? true : $protected;\r\n}\r\n<\/pre>\n<p>This code to hide a Custom Field Meta Key, just change mymetakey_no1 to meta key name that you wanted to hide. What if you want to hide two Meta Key?, add following to functions.php underneath above code<br \/>\n[\/php]<br \/>\nadd_filter(&#8216;is_protected_meta&#8217;, &#8216;my_is_protected_meta_filter2&#8217;, 10, 2);<br \/>\nfunction my_is_protected_meta_filter2($protected, $meta_key) {<br \/>\n    return $meta_key == &#8216;mymetakey_no2&#8217; ? true : $protected;<br \/>\n}<br \/>\n[\/php]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I learned this trick when someone asked about How to Hide Custom Fields Meta Key from Custom Fields panel. This trick useful when you want to hide certain Custom Fields Meta Key and Value from client or authors Add following code to functions.php add_filter(&#8216;is_protected_meta&#8217;, &#8216;my_is_protected_meta_filter1&#8217;, 10, 2); function my_is_protected_meta_filter1($protected, $meta_key) { return $meta_key == &#8216;mymetakey_no1&#8217; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":337,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[54,5],"tags":[55,135,6],"class_list":["post-326","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code-snippet","category-wordpress","tag-code-snippet-2","tag-custom-fields","tag-wordpress-2"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/10\/customfields.png?fit=810%2C300&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1pvi1-5g","jetpack-related-posts":[{"id":231,"url":"https:\/\/pixert.com\/blog\/wordpress-shortcode-in-custom-fields\/","url_meta":{"origin":326,"position":0},"title":"WordPress: Shortcode in Custom Field","author":"Pixel Insert \/ Pixert","date":"June 5, 2012","format":false,"excerpt":"Normally wordpress does not run shortcode that you put into a custom field. By default, Custom Fields display whatever value you enter, as plain-text, so if you try entering a shortcode, (in the format [shortcode] VALUE [\/shortcode]) you\u2019ll end up displaying the entire text, including the tags. Add the following\u2026","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2011\/03\/wordpresslogo-300x68.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":218,"url":"https:\/\/pixert.com\/blog\/how-to-fix-custom-field-for-thumbnails-wpzoom-featured-category-widget\/","url_meta":{"origin":326,"position":1},"title":"How to fix Custom Field for thumbnails in WPZoom Featured Category widget","author":"Pixel Insert \/ Pixert","date":"April 6, 2012","format":false,"excerpt":"WPZoom Featured Widget is a widget built inside WPZOOM themes to show Featured Category posts The widget display thumbnail images, post titles and post meta datas from selected Featured Category There's a bug in wpzoom-widgets.php where as all widgets code are. The widget cannot display thumbnail images from custom field\u2026","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2012\/04\/featuredcat-208x300.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":216,"url":"https:\/\/pixert.com\/blog\/how-to-show-world-map-as-default-view-pronamic-google-maps-plugin-wordpress\/","url_meta":{"origin":326,"position":2},"title":"How to show World Map as default view using Pronamic Google Maps plugin for WordPress","author":"Pixel Insert \/ Pixert","date":"March 26, 2012","format":false,"excerpt":"Pronamic Google Maps plugin is the best WordPress plugin for Google Maps \"With this plugin a user can easily add location (latitude, longitude) meta data to a page, post or a custom post type. This plugin adds a meta box with an Google Map to the post editor. Users can\u2026","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":300,"url":"https:\/\/pixert.com\/blog\/how-to-add-widgetized-custom-sidebars-wordpress-theme\/","url_meta":{"origin":326,"position":3},"title":"How to add widgetized and custom sidebars on WordPress theme","author":"Pixel Insert \/ Pixert","date":"April 13, 2013","format":false,"excerpt":"WordPress themes are usually come with Widgetized sidebars where you can drag and drop widgets. It's okay when we don't need more widgetized sidebars to the theme, but we probably think to add more when we think widgetized sidebar solution to your customization problem, for instance you want to add\u2026","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/04\/cs-newsidebar.jpg?fit=1200%2C822&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/04\/cs-newsidebar.jpg?fit=1200%2C822&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/04\/cs-newsidebar.jpg?fit=1200%2C822&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/04\/cs-newsidebar.jpg?fit=1200%2C822&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2013\/04\/cs-newsidebar.jpg?fit=1200%2C822&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":554,"url":"https:\/\/pixert.com\/blog\/a-micro-landing-page-for-social-media-with-wordpress-wp-mylinks\/","url_meta":{"origin":326,"position":4},"title":"A micro landing page for Social Media with WordPress, WP MyLinks","author":"Pixel Insert \/ Pixert","date":"March 22, 2021","format":false,"excerpt":"I need a micro landing page similar to Linktree but on top of WordPress. I could use Linktree but I already have a WordPress based website and my own domain which is good for my own branding. I found a plugin, WP MyLinks to make it happen. As the creator\u2026","rel":"","context":"In &quot;WordPress&quot;","block_context":{"text":"WordPress","link":"https:\/\/pixert.com\/blog\/category\/wordpress\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2021\/03\/AF5FD8F8-0BBF-422C-8294-335543A03248.jpeg?fit=1200%2C1045&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2021\/03\/AF5FD8F8-0BBF-422C-8294-335543A03248.jpeg?fit=1200%2C1045&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2021\/03\/AF5FD8F8-0BBF-422C-8294-335543A03248.jpeg?fit=1200%2C1045&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2021\/03\/AF5FD8F8-0BBF-422C-8294-335543A03248.jpeg?fit=1200%2C1045&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/pixert.com\/blog\/wp-content\/uploads\/2021\/03\/AF5FD8F8-0BBF-422C-8294-335543A03248.jpeg?fit=1200%2C1045&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":416,"url":"https:\/\/pixert.com\/blog\/wordpress-title-empty-on-index-page\/","url_meta":{"origin":326,"position":5},"title":"WordPress Title Empty on Index Page","author":"Pixel Insert \/ Pixert","date":"November 2, 2014","format":false,"excerpt":"Here's description from WordPress Codex about what happen when WordPress title empty when viewing index page\/ homepage If you are using a custom homepage with custom loops and stuff or a custom front-page, you will have an empty wp_title. I recently encountered this problem on a client's site. Homepage\/Index page\u2026","rel":"","context":"In &quot;Code Snippet&quot;","block_context":{"text":"Code Snippet","link":"https:\/\/pixert.com\/blog\/category\/code-snippet\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/comments?post=326"}],"version-history":[{"count":0,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/posts\/326\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/media\/337"}],"wp:attachment":[{"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/media?parent=326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/categories?post=326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pixert.com\/blog\/wp-json\/wp\/v2\/tags?post=326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}