Title: get_hidden_meta_boxes
Published: April 25, 2014
Last modified: May 20, 2026

---

# get_hidden_meta_boxes( string|WP_Screen $screen ): string[]

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/get_hidden_meta_boxes/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/get_hidden_meta_boxes/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_hidden_meta_boxes/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/get_hidden_meta_boxes/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/get_hidden_meta_boxes/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_hidden_meta_boxes/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/get_hidden_meta_boxes/?output_format=md#wp--skip-link--target)

Gets an array of IDs of hidden meta boxes.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/get_hidden_meta_boxes/?output_format=md#parameters)󠁿

 `$screen`string|[WP_Screen](https://developer.wordpress.org/reference/classes/wp_screen/)
required

Screen identifier

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_hidden_meta_boxes/?output_format=md#return)󠁿

 string[] IDs of hidden meta boxes.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_hidden_meta_boxes/?output_format=md#source)󠁿

    ```php
    function get_hidden_meta_boxes( $screen ) {
    	if ( is_string( $screen ) ) {
    		$screen = convert_to_screen( $screen );
    	}

    	$hidden = get_user_option( "metaboxhidden_{$screen->id}" );

    	$use_defaults = ! is_array( $hidden );

    	// Hide slug boxes by default.
    	if ( $use_defaults ) {
    		$hidden = array();

    		if ( 'post' === $screen->base ) {
    			if ( in_array( $screen->post_type, array( 'post', 'page', 'attachment' ), true ) ) {
    				$hidden = array( 'slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv' );
    			} else {
    				$hidden = array( 'slugdiv' );
    			}
    		}

    		/**
    		 * Filters the default list of hidden meta boxes.
    		 *
    		 * @since 3.1.0
    		 *
    		 * @param string[]  $hidden An array of IDs of meta boxes hidden by default.
    		 * @param WP_Screen $screen WP_Screen object of the current screen.
    		 */
    		$hidden = apply_filters( 'default_hidden_meta_boxes', $hidden, $screen );
    	}

    	/**
    	 * Filters the list of hidden meta boxes.
    	 *
    	 * @since 3.3.0
    	 *
    	 * @param string[]  $hidden       An array of IDs of hidden meta boxes.
    	 * @param WP_Screen $screen       WP_Screen object of the current screen.
    	 * @param bool      $use_defaults Whether to show the default meta boxes.
    	 *                                Default true.
    	 */
    	return apply_filters( 'hidden_meta_boxes', $hidden, $screen, $use_defaults );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/screen.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/screen.php#L152)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/screen.php#L152-L195)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/get_hidden_meta_boxes/?output_format=md#hooks)󠁿

 [apply_filters( ‘default_hidden_meta_boxes’, string[] $hidden, WP_Screen $screen )](https://developer.wordpress.org/reference/hooks/default_hidden_meta_boxes/)

Filters the default list of hidden meta boxes.

 [apply_filters( ‘hidden_meta_boxes’, string[] $hidden, WP_Screen $screen, bool $use_defaults )](https://developer.wordpress.org/reference/hooks/hidden_meta_boxes/)

Filters the list of hidden meta boxes.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_hidden_meta_boxes/?output_format=md#related)󠁿

| Uses | Description | 
| [convert_to_screen()](https://developer.wordpress.org/reference/functions/convert_to_screen/)`wp-admin/includes/template.php` |

Converts a screen string to a screen object.

  | 
| [get_user_option()](https://developer.wordpress.org/reference/functions/get_user_option/)`wp-includes/user.php` |

Retrieves user option that can be either per Site or per Network.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

[Show 1 more](https://developer.wordpress.org/reference/functions/get_hidden_meta_boxes/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/get_hidden_meta_boxes/?output_format=md#)

| Used by | Description | 
| [meta_box_prefs()](https://developer.wordpress.org/reference/functions/meta_box_prefs/)`wp-admin/includes/screen.php` |

Prints the meta box preferences for screen meta.

  | 
| [do_meta_boxes()](https://developer.wordpress.org/reference/functions/do_meta_boxes/)`wp-admin/includes/template.php` |

Meta-Box template function.

  | 
| [do_accordion_sections()](https://developer.wordpress.org/reference/functions/do_accordion_sections/)`wp-admin/includes/template.php` |

Meta Box Accordion Template Function.

  | 
| [post_comment_meta_box()](https://developer.wordpress.org/reference/functions/post_comment_meta_box/)`wp-admin/includes/meta-boxes.php` |

Displays comments for post.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_hidden_meta_boxes/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_hidden_meta_boxes%2F)
before being able to contribute a note or feedback.