Title: delete_blog_option
Published: April 25, 2014
Last modified: August 20, 2026

---

# delete_blog_option( int $id, string $option ): bool

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/delete_blog_option/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/delete_blog_option/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/delete_blog_option/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/delete_blog_option/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/delete_blog_option/?output_format=md#changelog)

Removes an option by name for a given blog ID. Prevents removal of protected WordPress
options.

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

 `$id`intrequired

A blog ID. Can be null to refer to the current blog.

`$option`stringrequired

Name of option to remove. Expected to not be SQL-escaped.

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

 bool True if the option was deleted, false otherwise.

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

    ```php
    function delete_blog_option( $id, $option ) {
    	$id = (int) $id;

    	if ( empty( $id ) ) {
    		$id = get_current_blog_id();
    	}

    	if ( get_current_blog_id() === $id ) {
    		return delete_option( $option );
    	}

    	switch_to_blog( $id );
    	$return = delete_option( $option );
    	restore_current_blog();

    	return $return;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-blogs.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/ms-blogs.php#L431)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/ms-blogs.php#L431-L447)

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

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

Removes an option by name. Prevents removal of protected WordPress options.

  | 
| [switch_to_blog()](https://developer.wordpress.org/reference/functions/switch_to_blog/)`wp-includes/ms-blogs.php` |

Switches the current blog.

  | 
| [restore_current_blog()](https://developer.wordpress.org/reference/functions/restore_current_blog/)`wp-includes/ms-blogs.php` |

Restores the current blog, after calling [switch_to_blog()](https://developer.wordpress.org/reference/functions/switch_to_blog/) .

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

Retrieves the current site ID.

  |

[Show 1 more](https://developer.wordpress.org/reference/functions/delete_blog_option/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/delete_blog_option/?output_format=md#)

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

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

## User Contributed Notes

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