Title: Cannot delete plugin
Last modified: November 8, 2023

---

# Cannot delete plugin

 *  Resolved [PluginRx](https://wordpress.org/support/users/apos37/)
 * (@apos37)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/cannot-delete-plugin-24/)
 * Hello. I tried deleting your plugin after deactivating it, and I get an error
   at the top of the screen that says `Deletion failed: error` . Checked my debug
   log and saw this:
 *     ```wp-block-code
       [08-Nov-2023 20:26:54 UTC] PHP Fatal error:  Uncaught Error: Undefined constant "Code_Snippets\Settings\OPTION_NAME" in .../wp-content/plugins/code-snippets/php/uninstall.php:27
       Stack trace:
       #0 .../wp-content/plugins/code-snippets/php/uninstall.php(79): Code_Snippets\Uninstall\complete_uninstall_enabled()
       #1 .../wp-content/plugins/code-snippets/uninstall.php(18): Code_Snippets\Uninstall\uninstall_plugin()
       #2 .../wp-admin/includes/plugin.php(1245): include_once('/home/voguumqsp...')
       #3 .../wp-admin/includes/plugin.php(960): uninstall_plugin()
       #4 .../wp-admin/includes/ajax-actions.php(4748): delete_plugins()
       #5 .../wp-includes/class-wp-hook.php(324): wp_ajax_delete_plugin()
       #6 .../wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
       #7 .../wp-includes/plugin.php(517): WP_Hook->do_action()
       #8 .../wp-admin/admin-ajax.php(188): do_action()
       #9 {main}
         thrown in .../wp-content/plugins/code-snippets/php/uninstall.php on line 27
       ```
   

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [bookofjohn](https://wordpress.org/support/users/bookofjohn/)
 * (@bookofjohn)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/cannot-delete-plugin-24/#post-17189468)
 * I’m having the same problem. This is the error message I get:
 * “Deletion failed: There has been a critical error on this website.Learn more 
   about troubleshooting WordPress.”
 *  [bookofjohn](https://wordpress.org/support/users/bookofjohn/)
 * (@bookofjohn)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/cannot-delete-plugin-24/#post-17189536)
 * I resolved my issue. I deleted the plugin from the File Manager.
 *  [Carl](https://wordpress.org/support/users/carlbtmn/)
 * (@carlbtmn)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/cannot-delete-plugin-24/#post-17193569)
 * Same issue here… (WordPress 6.4)
 * We need a fix for this ASAP. I want to make sure the uninstall process runs correctly
   and removes all the snippets and settings.
 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/cannot-delete-plugin-24/#post-17193663)
 * We’ve just released version 3.6.2, which should fix this problem.
 * Thank you for bringing it to our attention!
 *  Thread Starter [PluginRx](https://wordpress.org/support/users/apos37/)
 * (@apos37)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/cannot-delete-plugin-24/#post-17207480)
 * That fixed it. Thanks for the quick turnaround. I love your plugin, btw. No offense
   to removing it. Just needed to test something out.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Cannot delete plugin’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [PluginRx](https://wordpress.org/support/users/apos37/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/cannot-delete-plugin-24/#post-17207480)
 * Status: resolved