Title: get_options
Published: November 8, 2023
Last modified: April 28, 2025

---

# get_options( string[] $options ): array

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/get_options/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/get_options/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/get_options/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_options/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/get_options/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_options/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/get_options/?output_format=md#user-contributed-notes)

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

Retrieves multiple options.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/get_options/?output_format=md#description)󠁿

Options are loaded as necessary first in order to use a single database query at
most.

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

 `$options`string[]required

An array of option names to retrieve.

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

 array An array of key-value pairs for the requested options.

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

    ```php
    function get_options( $options ) {
    	wp_prime_option_caches( $options );

    	$result = array();
    	foreach ( $options as $option ) {
    		$result[ $option ] = get_option( $option );
    	}

    	return $result;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/option.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/option.php#L367)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/option.php#L367-L376)

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

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

Primes specific options into the cache with a single database query.

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

Retrieves an option value based on an option name.

  |

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

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

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

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/get_options/?output_format=md#comment-content-6887)
 2.   [Baikare Sandip](https://profiles.wordpress.org/baikaresandeep007-1/)  [  2 years ago  ](https://developer.wordpress.org/reference/functions/get_options/#comment-6887)
 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%2Ffunctions%2Fget_options%2F%23comment-6887)
    Vote results for this note: 1[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%2Ffunctions%2Fget_options%2F%23comment-6887)
 4. You can retrieves multiple options using option keys, like below:
 5.     ```php
        $options = get_options( array(
            'siteurl', 
            'blogname', 
            'blogdescription', 
            'posts_per_page', 
            'admin_email'
        ) 
        );
        // print all options keys
        print_r( $options );
    
        // print single option key
        echo esc_html( $options['admin_email'] );
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_options%2F%3Freplytocom%3D6887%23feedback-editor-6887)

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