# delete_transient()

URL: https://chugunov.pro/api-wordpress/functions/delete_transient/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 2.8.0.

## Сигнатура

```php
delete_transient( string $transient ): bool
```

## Описание

Удаляет транзиент.

## Параметры

- `$transient` `string` — обязательный. Имя транзиента. Ожидается, что не экранировано для SQL.

## Возвращаемое значение

`bool`

## Исходный код

Файл: `wp-includes/option.php:1378`

```php
function delete_transient( $transient ) {

	/**
	 * Fires immediately before a specific 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_transient_{$transient}", $transient );

	if ( wp_using_ext_object_cache() || wp_installing() ) {
		$result = wp_cache_delete( $transient, 'transient' );
	} else {
		$option_timeout = '_transient_timeout_' . $transient;
		$option         = '_transient_' . $transient;
		$result         = delete_option( $option );

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

	if ( $result ) {

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

	return $result;
}
```

## История изменений

- 2.8.0 — Introduced.

## Связанные

Использует: [`wp_installing`](https://chugunov.pro/api-wordpress/functions/wp_installing/), [`wp_cache_delete`](https://chugunov.pro/api-wordpress/functions/wp_cache_delete/), [`wp_using_ext_object_cache`](https://chugunov.pro/api-wordpress/functions/wp_using_ext_object_cache/), [`delete_option`](https://chugunov.pro/api-wordpress/functions/delete_option/), [`do_action`](https://chugunov.pro/api-wordpress/functions/do_action/).
Используется в: `WP_Automatic_Updater::has_fatal_error`, [`wp_edit_theme_plugin_file`](https://chugunov.pro/api-wordpress/functions/wp_edit_theme_plugin_file/), [`wp_dashboard_rss_control`](https://chugunov.pro/api-wordpress/functions/wp_dashboard_rss_control/), [`wp_widget_rss_form`](https://chugunov.pro/api-wordpress/functions/wp_widget_rss_form/), [`wp_upgrade`](https://chugunov.pro/api-wordpress/functions/wp_upgrade/), [`get_settings_errors`](https://chugunov.pro/api-wordpress/functions/get_settings_errors/), [`add_settings_error`](https://chugunov.pro/api-wordpress/functions/add_settings_error/), [`wp_maybe_generate_attachment_metadata`](https://chugunov.pro/api-wordpress/functions/wp_maybe_generate_attachment_metadata/), [`__clear_multi_author_cache`](https://chugunov.pro/api-wordpress/functions/__clear_multi_author_cache/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/delete_transient/
