Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get site option


Retrieve a network option value based on option name.

This function is almost identical to get_option(), except that in multisite, it returns the network-wide option. For non-multisite installs, it uses get_option.


<?php get_site_option$option$default $use_cache ?>


(string) (required) The name of the option to retrieve. Expected to not be SQL-escaped .
Default: None
(mixed) (optional) A value to return if the option doesn't exist.
Default: false
(boolean) (optional) Whether to use the cache. This has no effect on non-multisite installs.
Default: true

Return Values

Current value for the specified option. If the specified option does not exist, returns boolean FALSE.


Default Usage

echo get_site_option( 'siteurl' );

Passing a Default Value

$value = get_site_option( 'i_dont_exist' );

// $value == false

$value = get_site_option( 'i_dont_exist', 'blah' );

// $value == 'blah'


  • It is easy to get confused about the difference between get_option() and get_site_option(), because multisite used different terms before. Now there are different "sites" on a "network", before there where different "blogs" on a "site". Many functions and variables were introduced before this change, such as this one. Think of this function as "get_network_option()".

Change Log

Source File

get_site_option() is located in wp-includes/option.php.


See also index of Function Reference and index of Template Tags.