Uninstalling a module without leaving traces
Removing a module looks like the simplest operation in the world. In fact, disabling, uninstalling and deleting are three different things, and none of the three guarantees the module has left no trace in your store.
Disable, uninstall, delete: three distinct operations
Disabling stops the module running but touches nothing: its files stay, its tables stay, its settings stay, and its scheduled jobs can keep firing if they were registered on the server. Useful for a test, not for removal.
Uninstalling triggers the removal routine the module provides. A well-written module drops its tables, its settings and its hook attachments there. A badly written one does nothing at all, or fails silently. On WordPress the distinction is sharper still: the uninstall routine only runs when the extension is permanently deleted, not when it is deactivated, which almost nobody knows.
Deleting removes the files. If uninstalling didn’t happen first, the data stays in the database with no code left to read or clean it: that is what turns up years later.
What survives a botched uninstall
- Database tables still growing, with nothing left to read them
- Configuration rows loaded on every request, weighing on all pages
- Scheduled jobs registered on the server calling a file that no longer exists
- Menu entries or admin tabs pointing at nothing
- Files dropped outside the module folder: overrides, assets, images
- An access key to a third-party service still stored somewhere
How I remove a module cleanly
-
Back up first, files and database
Uninstalling is destructive by nature: it drops tables. If those tables hold useful history, export it first, because afterwards there is nothing left to export.
-
Uninstall before deleting
In that order, never the reverse. Deleting the files first makes uninstalling impossible and condemns the data to stay.
-
Look for what was placed elsewhere
Class overrides, assets added to the theme, scheduled jobs, admin entries. Those are rarely handled by the uninstall routine.
-
Clear caches and re-check the storefront
A removed module often leaves a visual trace until the cache is cleared, and an error may only show on a rarely visited page. I place a test order after any removal.
The particular case of tables left behind
This is what I meet most often on a store taken over: a database holding the tables of modules removed long ago, sometimes large, sometimes full of logs never purged. They don’t slow pages directly, since nothing reads them, but they weigh on backups, restores and migrations, and they blur the reading of the database for any future work.
Cleaning isn’t complicated but it demands care: you must know for certain which module each table belonged to before touching it. A table prefix resembling that of a removed module can belong to a module still active. I do that sorting on a copy of the database, and I keep a full export before any deletion.
Related pages
-
Cleaning the WordPress database
The procedure on the WordPress side, including settings left in place.
-
Auditing a store’s module estate
To know what is still used before deciding what goes.
-
Backing up the store before work starts
The backup to take before any uninstall, without exception.
-
Cron jobs don’t run
When a removed module leaves a scheduled job failing in a loop.
Describe your need in one minute
A few targeted questions so I can reply with an estimate rather than another questionnaire.