Title: Fatal error when trying to delete plugin
Last modified: March 16, 2025

---

# Fatal error when trying to delete plugin

 *  Resolved [freshpromo](https://wordpress.org/support/users/freshpromo/)
 * (@freshpromo)
 * [1 year ago](https://wordpress.org/support/topic/fatal-error-when-trying-to-delete-plugin/)
 * I installed this plugin before realizing that it hasn’t been updated in over 
   a year. I attempted to delete the plugin from the WP Dashboard > Plugins but 
   received a fatal error:
 * Deletion failed: {“code”:”qm_fatal”,”message”:”Uncaught Error: Undefined constant\”
   OC4EVERYONE_PREDEFINED_SERVER\” in /home/myaccount/public_html/mydomain.com/wp-
   content/plugins/object-cache-4-everyone/oc4-deactivation.php on line 13″,”data”:{“
   message”:”Uncaught Error: Undefined constant \”OC4EVERYONE_PREDEFINED_SERVER\””,”
   file”:”/home/myaccount/public_html/mydomain.com/wp-content/plugins/object-cache-
   4-everyone/oc4-deactivation.php”,”line”:13,”trace”:[{“file”:”/home/myaccount/
   public_html/mydomain.com/wp-content/plugins/object-cache-4-everyone/uninstall.
   php”,”line”:19,”function”:”oc4everyone_deactivation”,”args”:[]},{“file”:”/home/
   myaccount/public_html/mydomain.com/wp-admin/includes/plugin.php”,”line”:1314,”
   args”:[“/home/myaccount/public_html/mydomain.com/wp-content/plugins/object-cache-
   4-everyone/uninstall.php”],”function”:”include_once”},{“file”:”/home/myaccount/
   public_html/mydomain.com/wp-admin/includes/plugin.php”,”line”:970,”function”:”
   uninstall_plugin”,”args”:[“object-cache-4-everyone/object-cache-4-everyone.php”]},{“
   file”:”/home/myaccount/public_html/mydomain.com/wp-admin/includes/ajax-actions.
   php”,”line”:4771,”function”:”delete_plugins”,”args”:[[“object-cache-4-everyone/
   object-cache-4-everyone.php”]]},{“file”:”/home/myaccount/public_html/mydomain.
   com/wp-includes/class-wp-hook.php”,”line”:324,”function”:”wp_ajax_delete_plugin”,”
   args”:[“”]},{“file”:”/home/myaccount/public_html/mydomain.com/wp-includes/class-
   wp-hook.php”,”line”:348,”function”:”apply_filters”,”class”:”WP_Hook”,”type”:”-
   >”,”args”:[“”,[“”]]},{“file”:”/home/myaccount/public_html/mydomain.com/wp-includes/
   plugin.php”,”line”:517,”function”:”do_action”,”class”:”WP_Hook”,”type”:”->”,”
   args”:[[“”]]},{“file”:”/home/myaccount/public_html/mydomain.com/wp-admin/admin-
   ajax.php”,”line”:192,”function”:”do_action”,”args”:[“wp_ajax_delete-plugin”]}]}}
 * Please let me know how I can delete this plugin. Thank you.

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

 *  [marties](https://wordpress.org/support/users/marties/)
 * (@marties)
 * [12 months ago](https://wordpress.org/support/topic/fatal-error-when-trying-to-delete-plugin/#post-18416984)
 * hi, just use ftp to navigate to the plugins directory and delete the plugin
 *  Thread Starter [freshpromo](https://wordpress.org/support/users/freshpromo/)
 * (@freshpromo)
 * [9 months, 3 weeks ago](https://wordpress.org/support/topic/fatal-error-when-trying-to-delete-plugin/#post-18518223)
 * Do I need to remove any database tables? I’d like this to be as clean a removal
   as possible. Thanks.
 *  [trompetilla](https://wordpress.org/support/users/trompetilla/)
 * (@trompetilla)
 * [7 months ago](https://wordpress.org/support/topic/fatal-error-when-trying-to-delete-plugin/#post-18630829)
 * Surely you have another cache plugin that has installed also a object-cache.php
   file, and for this reason you are getting that error.
 * In the code you can see this before your error:
 * `if (defined('OC4EVERYONE_PREDEFINED_SERVER') || file_exists(WP_CONTENT_DIR .
   DIRECTORY_SEPARATOR . 'object-cache.php')) {`
 * So, it detects a object-cache.php file and then it fails in the next line that
   shows this:
 *     ```wp-block-code
               //Remove cache folder
               if (OC4EVERYONE_PREDEFINED_SERVER === '') {
       ```
   
 * Solutions:
    1. Disable the other plugin, uninstall this one and activate it again, or
    2. Edit the file wp-content/plugins/object-cache-4-everyone/oc4-deactivation.php
       and comment that block of code, and try again to uninstall it.
 *  Thread Starter [freshpromo](https://wordpress.org/support/users/freshpromo/)
 * (@freshpromo)
 * [5 months ago](https://wordpress.org/support/topic/fatal-error-when-trying-to-delete-plugin/#post-18710035)
 * Thank you, that worked.

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffatal-error-when-trying-to-delete-plugin%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/object-cache-4-everyone/assets/icon-256x256.png?rev=2306156)
 * [Object Cache 4 everyone](https://wordpress.org/plugins/object-cache-4-everyone/)
 * [Support Threads](https://wordpress.org/support/plugin/object-cache-4-everyone/)
 * [Active Topics](https://wordpress.org/support/plugin/object-cache-4-everyone/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/object-cache-4-everyone/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/object-cache-4-everyone/reviews/)

## Tags

 * [delete](https://wordpress.org/support/topic-tag/delete/)
 * [Install](https://wordpress.org/support/topic-tag/install/)
 * [undefined constant](https://wordpress.org/support/topic-tag/undefined-constant/)

 * 4 replies
 * 5 participants
 * Last reply from: [freshpromo](https://wordpress.org/support/users/freshpromo/)
 * Last activity: [5 months ago](https://wordpress.org/support/topic/fatal-error-when-trying-to-delete-plugin/#post-18710035)
 * Status: resolved