I’m looking for a way to change the default screen options in the post editor.
I want to hide certain options by default. I am putting together a family recipe site and don’t want to overwhelm users with too many options. I don’t want to log in as each user and changing their options manually. I’ve combed through WP core files and theme files and can’t find very many references to screen-options. Is it defined somewhere in the database?
Thanks in advance.
Use the default_hidden_meta_boxes filter
or
Bonus: To understand how it works have a look at the core function get_hidden_meta_boxes(). Here’s a simplified version:
The default screen options are saved in
wp_usermeta
themeta_key
ismetaboxhidden_post
.I think the easiest way to set default options (or to hide specific boxes) would be to use a plugin like adminimize. I personally use the advanced custom fields plugin for this task (and a lot more).
A slight modification to Zendka’s answer. I just wanted to remove one item from the list, leaving the array otherwise unchanged.
In my case I was removing the ‘authordiv’ from the hidden list, swap that out with whatever metabox you want to remove from the hidden meta boxes.
I don’t check for the existence of the metabox before unsetting it, because it doesn’t produce any PHP notices/errors if there are no results from the array_search.