Digital Insights Blog > Removing Unused Modules in Drupal 8
Removing Unused Modules in Drupal 8
- 2 min read
Highlights
- Maintaining your Drupal 8 site involves removing unused modules for security, better performance, and reduced site clutter.
- Updating every module ensures security; avoid modules not in use to lessen workload.
- Drupal is an event-based CMS, continually checking for any active module interventions during the page-build process.
- Always uninstall a module before deleting its code to allow the module's uninstall configuration file to function correctly.
- Removal of a data-writing module will delete all data associated with it; after uninstallation, complete removal of module code from the codebase is critical.
One of the important aspects of keeping your Drupal 8 site up-to-date, secure, and performing well is to remove unused modules.
Protect Security: Every module should be kept up-to-date to keep them secure, and if you’re not using a particular feature, you’re just giving yourself more work to do.
Improve Performance: Drupal is an event-based CMS so at every point in the page-build process, Drupal is checking to see if any module on your site wants to do something.
Get rid of site clutter: The “Extend” menu is long enough! Not to mention any configuration menu items that a module might add.
Step 1: Uninstall
When you install a module on your site, depending on the module, a number of things happen. The code is added to the /modules folder. However, if that module stores data in the database, then tables are created and sample data may be installed.
It’s important to uninstall a module before you remove the code so the module’s uninstall configuration file can perform its tasks.
It’s also worthy to note that if you simply delete the code without uninstalling, you might encounter a huge performance regression which stems from Drupal recursively searching through the site for the “missing” module on every page load.
Caution: When you uninstall a module that writes data to the database, all of your data will be deleted.
To uninstall a module:
1. Log into your Drupal site and in the Manage administrative menu, click on Extend -> Uninstall where you will find the list of modules that are ready to be uninstalled.
2. Check the boxes for the modules you are uninstalling (Search, History, and Activity Tracker).
3. Scroll down to the bottom of the page and click “Uninstall.”
4. If a module has dependencies, you’ll need to uninstall the module that requires something else first, then the main module second.
For example, Admin Toolbar cannot be uninstalled until Admin Toolbar Extras is uninstalled.
5. Remove the module code from the codebase. As you may know, uninstalling a module in Drupal doesn’t actually remove the code from the codebase. The code stays in the /modules folder, ready to be installed again. It’s always safest to completely removed the code from your codebase. If you do not have access to the codebase, you will need to ask your IT department or web host to do that for you.
6. Once you gain access to the codebase, you’ll look for the modules folder. Your module will be listed via the machine name. Just delete the entire folder.
Boom, done!
A global team of digerati with offices in Washington, D.C. and Southern California, we provide digital marketing, web design, and creative for brands you know and nonprofits you love.
Follow us to receive the latest digital insights:
- 7 min read
Five years ago, most marketing teams had little reason to care which bots were reading their websites. Googlebot was welcome, obvious troublemakers weren’t and much of what happened in between...
- 8 min read
Artificial intelligence is rapidly becoming another place where consumers research products, evaluate services, and make purchasing decisions. That naturally raises a question for marketers: Can we advertise there? As of...
- 4 min read
Website Design Trends to Watch For several years, website design seemed to be converging on a familiar formula: a large hero image, a short headline, a row of cards, plenty...
- 10 min read
For the past couple of years, marketers have been told that search is changing. Google AI Overviews, AI Mode and other generative AI tools increasingly answer questions directly, changing both...