Title: WP_Object_Cache::reset
Published: April 25, 2014
Last modified: April 28, 2025

---

# WP_Object_Cache::reset()

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/WP_Object_Cache/reset/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/classes/WP_Object_Cache/reset/?output_format=md#see-also)
 * [Source](https://developer.wordpress.org/reference/classes/WP_Object_Cache/reset/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/WP_Object_Cache/reset/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/WP_Object_Cache/reset/?output_format=md#changelog)

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

This method has been deprecated since 3.5.0. Use [switch_to_blog()](https://developer.wordpress.org/reference/functions/switch_to_blog/)
instead.

Resets cache keys.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/WP_Object_Cache/reset/?output_format=md#description)󠁿

### 󠀁[See also](https://developer.wordpress.org/reference/classes/WP_Object_Cache/reset/?output_format=md#see-also)󠁿

 * [switch_to_blog()](https://developer.wordpress.org/reference/functions/switch_to_blog/)

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

    ```php
    public function reset() {
    	_deprecated_function( __FUNCTION__, '3.5.0', 'WP_Object_Cache::switch_to_blog()' );

    	// Clear out non-global caches since the blog ID has changed.
    	foreach ( array_keys( $this->cache ) as $group ) {
    		if ( ! isset( $this->global_groups[ $group ] ) ) {
    			unset( $this->cache[ $group ] );
    		}
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-object-cache.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-object-cache.php#L614)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-object-cache.php#L614-L623)

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

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

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

  |

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

Resets internal cache keys and structures.

  |

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

| Version | Description | 
| [3.5.0](https://developer.wordpress.org/reference/since/3.5.0/) | Deprecated. Use [WP_Object_Cache::switch_to_blog()](https://developer.wordpress.org/reference/classes/wp_object_cache/switch_to_blog/) | 
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |

## User Contributed Notes

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