I recently updated my website after a while, and the custom fields meta box is not showing in the editor anymore. It isn't showing under "Screen Options" either. Any ideas why this could be, and how to get it back?
-
Is that screenshot coming from the edit page for a CPT? Maybe the CPT doesn't have custom fields enabled, or you need to re-enable it back after the update. There might also be a plugin which hides/disables the meta box on that page.– Sally CJOct 20, 2018 at 23:09
-
It is from a CPT, but it's just the same on regular posts.– PimOct 20, 2018 at 23:17
-
Try to disable all plugins? And sorry, I meant "custom fields" when I said "meta box".– Sally CJOct 20, 2018 at 23:26
-
1It's the ACF plugin that removes default custom fields display, but I haven't found a way around it. I need both ACF and default custom fields metaboxes.– PimOct 21, 2018 at 18:36
-
1+1 for both the helpful answer and question. =)– Sally CJOct 22, 2018 at 3:16
2 Answers
It turns out the latest Advanced Custom Fields update (from version 5.6.0 on) removes the core custom fields metaboxes by default.
The way to restore it was to add a filter in functions.php
:
add_filter('acf/settings/remove_wp_meta_box', '__return_false');
When registering a custom post type you have to declare that it supports the custom fields meta box to get it, e.g.:
'supports' => array( 'title', 'editor', 'custom-fields' )
But most people don't do this, and build real metaboxes instead. This way instead they can put in radio buttons and drop downs etc