Title: pre_uninstall_plugin
Published: April 12, 2016
Last modified: February 24, 2026

---

# do_action( ‘pre_uninstall_plugin’, string $plugin, array $uninstallable_plugins )

## In this article

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

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

Fires in [uninstall_plugin()](https://developer.wordpress.org/reference/functions/uninstall_plugin/)
immediately before the plugin is uninstalled.

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

 `$plugin`string

Path to the plugin file relative to the plugins directory.

`$uninstallable_plugins`array

Uninstallable plugins.

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

    ```php
    do_action( 'pre_uninstall_plugin', $plugin, $uninstallable_plugins );
    ```

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

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

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

Uninstalls a single plugin.

  |

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

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

## User Contributed Notes

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