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

---

# delete_site_transient( string $transient ): bool

## In this article

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

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

Deletes a site transient.

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

 `$transient`stringrequired

Transient name. Expected to not be SQL-escaped.

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

 bool True if the transient was deleted, false otherwise.

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

    ```php
    function delete_site_transient( $transient ) {

    	/**
    	 * Fires immediately before a specific site transient is deleted.
    	 *
    	 * The dynamic portion of the hook name, `$transient`, refers to the transient name.
    	 *
    	 * @since 3.0.0
    	 *
    	 * @param string $transient Transient name.
    	 */
    	do_action( "delete_site_transient_{$transient}", $transient );

    	if ( wp_using_ext_object_cache() || wp_installing() ) {
    		$result = wp_cache_delete( $transient, 'site-transient' );
    	} else {
    		$option_timeout = '_site_transient_timeout_' . $transient;
    		$option         = '_site_transient_' . $transient;
    		$result         = delete_site_option( $option );

    		if ( $result ) {
    			delete_site_option( $option_timeout );
    		}
    	}

    	if ( $result ) {

    		/**
    		 * Fires after a transient is deleted.
    		 *
    		 * @since 3.0.0
    		 *
    		 * @param string $transient Deleted transient name.
    		 */
    		do_action( 'deleted_site_transient', $transient );
    	}

    	return $result;
    }
    ```

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

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/delete_site_transient/?output_format=md#hooks)󠁿

 [do_action( ‘deleted_site_transient’, string $transient )](https://developer.wordpress.org/reference/hooks/deleted_site_transient/)

Fires after a transient is deleted.

 [do_action( “delete_site_transient_{$transient}”, string $transient )](https://developer.wordpress.org/reference/hooks/delete_site_transient_transient/)

Fires immediately before a specific site transient is deleted.

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

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

Checks or sets whether WordPress is in “installation” mode.

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

Removes the cache contents matching key and group.

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

Toggles `$_wp_using_ext_object_cache` on and off without directly touching global.

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

Removes an option by name for the current network.

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

Calls the callback functions that have been added to an action hook.

  |

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

| Used by | Description | 
| [WP_Theme::delete_pattern_cache()](https://developer.wordpress.org/reference/classes/wp_theme/delete_pattern_cache/)`wp-includes/class-wp-theme.php` |

Clears block pattern cache.

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

Clears existing update caches for plugins, themes, and core.

  | 
| [Core_Upgrader::upgrade()](https://developer.wordpress.org/reference/classes/core_upgrader/upgrade/)`wp-admin/includes/class-core-upgrader.php` |

Upgrades WordPress core.

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

Removes a theme.

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

Determines the status we can perform on a plugin.

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

Clears the plugins cache used by [get_plugins()](https://developer.wordpress.org/reference/functions/get_plugins/) and by default, the plugin updates cache.

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

Upgrades the core of WordPress.

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

Clears the cache held by [get_theme_roots()](https://developer.wordpress.org/reference/functions/get_theme_roots/) and [WP_Theme](https://developer.wordpress.org/reference/classes/wp_theme/).

  | 
| [WP_Feed_Cache_Transient::unlink()](https://developer.wordpress.org/reference/classes/wp_feed_cache_transient/unlink/)`wp-includes/class-wp-feed-cache-transient.php` |

Deletes transients.

  |

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

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

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

## User Contributed Notes

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