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

---

# apply_filters_deprecated( ‘whitelist_options’, array $allowed_options )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/whitelist_options/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/whitelist_options/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/hooks/whitelist_options/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/whitelist_options/?output_format=md#user-contributed-notes)

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

This hook has been deprecated since 5.5.0. Use {@see ‘allowed_options’} instead.

Filters the allowed options list.

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

 `$allowed_options`array

The allowed options list.

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

    ```php
    $allowed_options = apply_filters_deprecated(
    	'whitelist_options',
    	array( $allowed_options ),
    	'5.5.0',
    	'allowed_options',
    	__( 'Please consider writing more inclusive code.' )
    );
    ```

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

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

| Version | Description | 
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Deprecated. Use ['allowed_options'](https://developer.wordpress.org/reference/hooks/allowed_options/) instead. | 
| [2.7.0](https://developer.wordpress.org/reference/since/2.7.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/whitelist_options/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/whitelist_options/?output_format=md#comment-content-2719)
 2.   [arnoutpullen](https://profiles.wordpress.org/arnoutpullen/)  [  8 years ago  ](https://developer.wordpress.org/reference/hooks/whitelist_options/#comment-2719)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwhitelist_options%2F%23comment-2719)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwhitelist_options%2F%23comment-2719)
 4. Example how to add whitelist_options.
 5.     ```php
        $sections = array(
        	'section-one' => array(
        		'option-one',
        		'option-two'
        	),
        	'section-two' => array(
        		'option-one',
        		'option-two'
        	),
        );
    
        add_filter('whitelist_options', function($whitelist_options) use ($sections) {
        	foreach($sections as $section => $fields) {
        		foreach($fields as $field) {
        			$whitelist_options[$section][] = $field;
        		}
        	}
        	return $whitelist_options;
        });
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwhitelist_options%2F%3Freplytocom%3D2719%23feedback-editor-2719)

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