Title: wp_cache_flush
Published: April 25, 2014
Last modified: April 28, 2025

---

# wp_cache_flush(): bool

## In this article

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

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

Removes all cache items.

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

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

 * [WP_Object_Cache::flush()](https://developer.wordpress.org/reference/classes/WP_Object_Cache/flush/)

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

 bool True on success, false on failure.

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

    ```php
    function wp_cache_flush() {
    	global $wp_object_cache;

    	return $wp_object_cache->flush();
    }
    ```

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

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

| Uses | Description | 
| [WP_Object_Cache::flush()](https://developer.wordpress.org/reference/classes/wp_object_cache/flush/)`wp-includes/class-wp-object-cache.php` |

Clears the object cache of all data.

  |

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

Removes all cache items from the in-memory runtime cache.

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

Runs WordPress Upgrade functions.

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

Installs the site.

  | 
| [update_core()](https://developer.wordpress.org/reference/functions/update_core/)`wp-admin/includes/update-core.php` |

Upgrades the core of WordPress.

  |

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

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

## User Contributed Notes

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