How Does WordPress Uninclude/Deactivate A Plugin?

The active plugins are stored in the ‘active_plugins’ option, like this:

array(
  'akismet/akismet.php',
  'hello-dolly.php',
);

On each page load, WP just loops through that array and includes those files. It’s up to each plugin to include any additional files that it may have.

When a plugin is deactivated, it’s just removed from that array. On the next page load, it won’t be included anymore.

No “un-including” required.

Leave a Comment