Title: cannot delete plugin
Last modified: March 27, 2023

---

# cannot delete plugin

 *  Resolved [mjb502](https://wordpress.org/support/users/mjb502/)
 * (@mjb502)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/cannot-delete-plugin-23/)
 * Something to do with removing the capability? Here is the error:
 * Installation “My Website”: PHP Fatal error: Uncaught Error: Call to undefined
   function ElasticPress\Utils\get_capability() in /var/www/vhosts/mywebsite.com/
   httpdocs/wp-content/plugins/elasticpress/uninstall.php:195 Stack trace: #0 /var/
   www/vhosts/mywebsite.com/httpdocs/wp-content/plugins/elasticpress/uninstall.php(
   101): EP_Uninstaller->remove_elasticpress_capability() #1 /var/www/vhosts/mywebsite.
   com/httpdocs/wp-content/plugins/elasticpress/uninstall.php(223): EP_Uninstaller-
   >__construct() #2 /var/www/vhosts/mywebsite.com/httpdocs/wp-admin/includes/plugin.
   php(1241): include_once(‘/var/www/vhosts…’) #3 /opt/psa/admin/plib/modules/wp-
   toolkit/vendor/wp-cli/vendor/wp-cli/extension-command/src/Plugin_Command.php(
   921): uninstall_plugin() #4 [internal function]: Plugin_Command->uninstall() #
   5 /opt/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/
   WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func() #6 [internal function]:
   WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}() #7 /opt/psa/adm
   in /var/www/vhosts/mywebsite.com/httpdocs/wp-content/plugins/elasticpress/uninstall.
   php on line 195 Fatal error: Uncaught Error: Call to undefined function ElasticPress\
   Utils\get_capability() in /var/www/vhosts/mywebsite.com/httpdocs/wp-content/plugins/
   elasticpress/uninstall.php:195 Stack trace: #0 /var/www/vhosts/mywebsite.com/
   httpdocs/wp-content/plugins/elasticpress/uninstall.php(101): EP_Uninstaller->
   remove_elasticpress_capability() #1 /var/www/vhosts/mywebsite.com/httpdocs/wp-
   content/plugins/elasticpress/uninstall.php(223): EP_Uninstaller->__construct()#
   2 /var/www/vhosts/mywebsite.com/httpdocs/wp-admin/includes/plugin.php(1241): 
   include_once(‘/var/www/vhosts…’) #3 /opt/psa/admin/plib/modules/wp-toolkit/vendor/
   wp-cli/vendor/wp-cli/extension-command/src/Plugin_Command.php(921): uninstall_plugin()#
   4 [internal function]: Plugin_Command->uninstall() #5 /opt/psa/admin/plib/modules/
   wp-toolkit/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.
   php(100): call_user_func() #6 [internal function]: WP_CLI\Dispatcher\CommandFactory::
   WP_CLI\Dispatcher\{closure}() #7 /opt/psa/adm in /var/www/vhosts/mywebsite.com/
   httpdocs/wp-content/plugins/elasticpress/uninstall.php on line 195 Error: There
   has been a critical error on this website.Learn more about troubleshooting WordPress.
   There has been a critical error on this website.

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Felipe Elia](https://wordpress.org/support/users/felipeelia/)
 * (@felipeelia)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/cannot-delete-plugin-23/#post-16599753)
 * Thanks for the report, [@mjb502](https://wordpress.org/support/users/mjb502/)!
   I was able to reproduce the problem and a fix will be available in our next release.
   Here is the Pull Request with the change we made: [https://github.com/10up/ElasticPress/pull/3407](https://github.com/10up/ElasticPress/pull/3407)
 * As [we don’t provide support here](https://wordpress.org/support/topic/read-before-posting-12/),
   please leave a comment in that Pull Request if you have any following up questions
   or comments.

Viewing 1 replies (of 1 total)

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

 * ![](https://ps.w.org/elasticpress/assets/icon-256x256.jpg?rev=2458479)
 * [ElasticPress](https://wordpress.org/plugins/elasticpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/elasticpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/elasticpress/)
 * [Active Topics](https://wordpress.org/support/plugin/elasticpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/elasticpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/elasticpress/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Felipe Elia](https://wordpress.org/support/users/felipeelia/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/cannot-delete-plugin-23/#post-16599753)
 * Status: resolved