Title: Plugin code changed but can&#039;t undeclare class
Last modified: August 21, 2016

---

# Plugin code changed but can't undeclare class

 *  [sbryce138](https://wordpress.org/support/users/sbryce138/)
 * (@sbryce138)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/plugin-code-changed-but-cant-undeclare-class/)
 * Hi,
 * I am using a plugin which has updated recently for the flickr api authentication
   change. However the plugin class seems to be loaded into memory and it doesn’t
   look like you can undeclare a class!
 * The class is declared with:
 *     ```
       if ( !class_exists('myClass') ) {
   
         class myClass {
         }
   
       }
       ```
   
 * The plugin update has changed this class (new links stored in variables), but
   because it has already been declared the new class code never gets read. I proved
   this with echo statements, and I can see that the object instantiated has the
   old class variables set.
 * I am using wordpress which is hosted by my provider. I do not have the ability
   to restart my server. My wordpress is at the latest version. I have tried disabling
   the plugin and reactivating it. I have also tried deleting it completely and 
   reinstalling (via FTP and via the worpress page). Nothing has worked. I even 
   tried changing my php version on my web server! This class is declared and does
   not want to let go 🙁
 * I have hacked my way around it by renaming the class and updating any reference
   to the new name, this loading the new class code. This seems unnecessary and 
   I am sure there must be a way around this.
 * Does anyone know how I can unload this class and reload the new one?
 * Thanks,
    Stewart

The topic ‘Plugin code changed but can't undeclare class’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [sbryce138](https://wordpress.org/support/users/sbryce138/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/plugin-code-changed-but-cant-undeclare-class/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
