How to Remove Unused Modules in Drupal 8
One of the important aspects of keeping your Drupal 8 site up-to-date, secure and performing well is to get rid of unused modules.
Small Web Design Company In Bangalore is explain there are kind of reasons why you'd want to try and do this:
Security - Every module should be kept up-to-date. If you are not utilize particular feature, you're just giving yourself more work to try and do.
Performance - Drupal is an event-based CMS so at every point within the page-build process, Drupal is checking to check if any module on your site wants to try and do something. All of this adds up!
Site clutter - The "Extend" menu is long enough! to not mention any configuration menu items that a module might add.
Fluff - Some modules just don't belong - Some development modules like Devel should never get on a production server. it is usually best to get rid of those completely.
Step 1: Uninstall
When you install a module on your site, looking on the module, many of things happen. Obviously the code is added to the /modules folder. However, if that module stores data within the database, then tables are created and sample data could also be installed. it is important to uninstall a module before you remove the code therefore the module's uninstall configuration file can perform it's tasks.
It's also worthy to notice that if you just delete the code without uninstalling, you would possibly encounter a large performance regression which stems from Drupal recursively looking through the website for the "missing" module on every page load.
Caution: once you uninstall a module that does write data to the database, all of your data are going to be deleted.
To uninstall a module:
Log into your Drupal site and click on on Extend -> Uninstall
Find the module you want to uninstall and put a checkmark within the box.
Scroll right down to the lowest of the page and click on "Uninstall".
If a module has dependencies, you will need to uninstall the module that needs something else first, then the most module second. as an example, Admin Toolbar can't be uninstalled until Admin Toolbar Extras is uninstalled.
Step 2: Remove the module code from the codebase
As you'll know, uninstalling a module in Drupal doesn't actually remove the code from the codebase. The code stays within the /modules folder, able to be installed again. it is often safest to completely removed the code from your codebase.
Responsive Web Development Services Bangalore suggests that if you are doing not have access to the codebase, you'll got to ask your IT department or web host to try to to that for you. If your website is hosted on something like Acquia Cloud or Pantheon, those tools are built-in. If your site is hosted on a preferred hosting service like Hostgator, Hostmonster or Bluehost, you'll do this via CPanel. If your site is hosted on a service like Digital Ocean, you'll have SSH access to delete the files. It's beyond the scope of this tutorial to dive into every service, but suffice it to mention, the files should be deleted.
Once you gain access to the codebase, you'll search for the modules folder. Your module are going to be listed via the machine name. Just delete the whole folder. within the illustration below, to delete the Asset Injector module, you'd delete the asset_injector folder.
One Final Thought
While it'd be tempting to uninstall Core modules that you are not using, it really won't help. The modules you remove are going to be reinstalled on future Drupal update regardless. If you want more help then Hire Website Developer India.
Comments
Post a Comment