Title: update_blog_option
Published: April 25, 2014
Last modified: February 24, 2026

---

# update_blog_option( int $id, string $option, mixed $value, mixed $deprecated = null ): bool

## In this article

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

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

Updates an option for a particular blog.

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

 `$id`intrequired

The blog ID.

`$option`stringrequired

The option key.

`$value`mixedrequired

The option value.

`$deprecated`mixedoptional

Not used.

Default:`null`

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

 bool True if the value was updated, false otherwise.

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

    ```php
    function update_blog_option( $id, $option, $value, $deprecated = null ) {
    	$id = (int) $id;

    	if ( null !== $deprecated ) {
    		_deprecated_argument( __FUNCTION__, '3.1.0' );
    	}

    	if ( get_current_blog_id() === $id ) {
    		return update_option( $option, $value );
    	}

    	switch_to_blog( $id );
    	$return = update_option( $option, $value );
    	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/6.9.4/src/wp-includes/ms-blogs.php#L460)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/ms-blogs.php#L460-L476)

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

| Uses | Description | 
| [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.

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

Marks a function argument as deprecated and inform when it has been used.

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

Updates the value of an option that was already added.

  |

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

| Used by | Description | 
| [wp_update_blog_public_option_on_site_update()](https://developer.wordpress.org/reference/functions/wp_update_blog_public_option_on_site_update/)`wp-includes/ms-site.php` |

Updates the `blog_public` option for a given site ID.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/update_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](https://developer.wordpress.org/reference/functions/update_blog_option/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 2 content](https://developer.wordpress.org/reference/functions/update_blog_option/?output_format=md#comment-content-3166)
 2.    [Xedin Unknown](https://profiles.wordpress.org/xedinunknown/)  [  7 years ago  ](https://developer.wordpress.org/reference/functions/update_blog_option/#comment-3166)
 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%2Fupdate_blog_option%2F%23comment-3166)
     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%2Fupdate_blog_option%2F%23comment-3166)
 4.  The [return documentation](https://developer.wordpress.org/reference/functions/update_blog_option/#return)
     states:
 5.  > (bool) True on success, false on failure.
 6.  However, this is not true. This function uses [`update_option()`](https://developer.wordpress.org/reference/functions/update_option/)
     under the hood, and returns its result verbatim. It’s not in the reference, but
     the [Codex doc](https://codex.wordpress.org/Function_Reference/update_option#Return_Value)
     of `update_option()` states:
 7.  > (boolean)
     >  True if option value has changed, false if not or if update failed.
 8.  `update_option()` will return `false` if the value **has not changed**, such as
     if the new value is the same as the old, and therefore so will `update_blog_option()`.
     Thus, just because it returns `false` does not mean there was an error.
 9.  Also, see [this helpful comment](https://developer.wordpress.org/reference/functions/update_option/#comment-880).
 10.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fupdate_blog_option%2F%3Freplytocom%3D3166%23feedback-editor-3166)

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