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

WPMU Functions/add site option


Adds a new site option and returns the ID of the inserted post in the table (wp_sitemeta).

Existing site options will not be updated by this function.

NB: Prior to WordPress 3.3 this was not the case. Previously this function would overwrite an option of the same name which already existed. You may have to be careful to check that the option does not already exist if you do not want to overwrite it.


(string) (required) The name of the site option to set.
Default: None
(string or array) (required) The value of the site option.
Default: None

Return Values

Returns the value of the inserted rows id.


<?php add_site_option($key$value); ?>


To get the value that has been set is done by using the function WPMU_Functions/get_site_option.