function delete_site_option( $option ) {}

Removes site option by name.


  • string $option: Name of option to remove. Expected to not be SQL-escaped.

Return values

returns:True, if succeed. False, if failure.

Defined actions

  • pre_delete_site_option_’.$option
    do_action( 'pre_delete_site_option_' . $option );

Source code

function delete_site_option( $option ) {

	global $wpdb;

	// ms_protect_special_option( $option ); @todo

	do_action( 'pre_delete_site_option_' . $option );

	if ( !is_multisite() ) {

		$result = delete_option( $option );

	} else {

		$row = $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM {$wpdb->sitemeta} WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) );

		if ( is_null( $row ) || !$row->meta_id )

			return false;

		$cache_key = "{$wpdb->siteid}:$option";


No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: