How to fix a compromised website plugin
Summary
This guide helps you troubleshoot and resolve: How to fix a compromised website plugin. Follow the steps below to fix the issue.
Common Causes
If your website uses a Content Management System such as WordPress, Joomla, or Drupal, outdated or abandoned plugins can create security vulnerabilities that allow unauthorised access to your site and hosting account. Attackers may inject malicious code, redirect visitors to harmful pages, or use your server to send spam. This article explains how to identify signs of a compromised plugin, safely remove suspicious extensions, and restore your site from a clean backup.
Signs your site may be compromised
Before taking action, look for common indicators that a plugin has been exploited:
- Visitors being redirected to unfamiliar or harmful websites
- New, unknown administrator accounts created in your CMS
- Suspicious files appearing in your website directories
- Hosting alerts about spam being sent from your server
- Unexpected changes to website content or appearance
- Security warnings from search engines or browsers
Quick fix steps
- Put your website into maintenance mode if possible.
- Create a full backup of your site files and database.
- Scan your site for malware and identify compromised files.
- Identify and deactivate the compromised plugin.
- Remove the plugin files from your server.
- Restore your site from a clean, pre-compromise backup.
- Update all remaining plugins, themes, and the CMS core.
- Change all relevant passwords, including CMS admin, hosting, and database credentials.
- Scan your local computer for malware that may have stolen credentials.
Detailed instructions
Step 1: Back up your website
Before making any changes, download a complete copy of your website files and export your database. This ensures you can revert if something goes wrong during the cleanup process.
- Log in to your hosting control panel.
- Open the File Manager or use an FTP client such as FileZilla.
- Download all files from your website's root directory (commonly
public_htmlorwww). - Open phpMyAdmin and export your website database to a
.sqlfile.
Step 2: Identify the compromise date
Identifying when the compromise occurred is critical to selecting a clean backup. Restoring from a backup taken after the breach will simply reinstate the malicious code.
- Review your hosting access logs and CMS error logs for unusual activity spikes or unexpected POST requests.
- Check the modification dates of plugin files via your hosting control panel's File Manager.
- Review the list of administrator users in your CMS to see when unknown accounts were created.
- Note the date and time when visitors first reported redirects or security warnings.
Step 3: Identify the compromised plugin
Review your CMS admin dashboard for recently installed or updated extensions. Look for plugins that are outdated, no longer supported by their developer, or that you do not recognise.
WordPress
- Log in to your WordPress admin dashboard.
- Navigate to Plugins > Installed Plugins.
- Look for plugins with a red update notification or those not updated in over a year.
Joomla
- Log in to your Joomla administrator panel.
- Navigate to Extensions > Manage > Manage.
- Check the version numbers and look for extensions marked as outdated.
Drupal
- Log in to your Drupal admin dashboard.
- Navigate to Extend.
- Review the list of installed modules for any that are no longer maintained.
Step 4: Deactivate and remove the plugin
Deactivate the suspicious plugin immediately to stop the exploit from running. After deactivation, remove the plugin files entirely from your server.
WordPress
- Go to Plugins > Installed Plugins.
- Click Deactivate beneath the suspicious plugin.
- Once deactivated, click Delete to remove the plugin from your site.
- Connect via FTP or File Manager and navigate to
/wp-content/plugins/. - Manually delete the plugin folder if any files remain.
Joomla
- Go to Extensions > Manage > Manage.
- Select the checkbox next to the suspicious extension.
- Click the Uninstall button in the toolbar.
- Connect via FTP or File Manager and navigate to
/plugins/or/modules/depending on the extension type. - Manually delete the extension folder if any files remain.
Drupal
- Go to Extend.
- Uncheck the box next to the module you wish to disable.
- Click the Uninstall button at the bottom of the page.
- Connect via FTP or File Manager and navigate to
/modules/contrib/or/modules/custom/. - Manually delete the module folder if any files remain.
akismet to akismet.disabled.Step 5: Verify backup integrity and restore
Select a backup created before the date of compromise identified in Step 2. Verify that the backup files are not corrupted before uploading them to your server.
WordPress
- Upload your clean website files via FTP or File Manager, overwriting existing files in
public_html. - Open phpMyAdmin, select your website database, and use the Import tab to upload your clean
.sqlfile. - Log in to the WordPress dashboard and go to Users > All Users to ensure no unfamiliar administrator accounts exist.
Joomla
- Upload your clean website files via FTP or File Manager, overwriting existing files in
public_html. - Open phpMyAdmin, select your Joomla database, and use the Import tab to upload your clean
.sqlfile. - Log in to the Joomla administrator panel and go to Users > Manage to check for unknown accounts.
Drupal
- Upload your clean website files via FTP or File Manager, overwriting existing files in
public_html. - Open phpMyAdmin, select your Drupal database, and use the Import tab to upload your clean
.sqlfile. - Log in to the Drupal dashboard and go to People to check for unknown administrator accounts.
Step 6: Update everything
Ensure your entire stack is up to date to close known security holes.
WordPress
- Go to Dashboard > Updates and update the WordPress core.
- Go to Plugins > Installed Plugins and update all active plugins.
- Go to Appearance > Themes and update your active theme.
Joomla
- Go to Components > Joomla Update to update the core.
- Go to Extensions > Manage > Update to update extensions.
Drupal
- Go to Reports > Available updates to check for core and module updates.
- Use the Extend page to update contributed modules.
Step 7: Change your passwords
Attackers may have harvested credentials during the compromise. Change the following credentials immediately after restoration:
- CMS administrator passwords
- Hosting control panel passwords
- Database user passwords
- FTP and SSH account passwords
Step 8: Scan your local computer
Attackers may have stolen credentials from your computer. Run a full antivirus scan on any device used to access your website or hosting account.
Troubleshooting
Site still crashes after removing the plugin
If unexpected site crashes continue, check your error logs for specific file paths and consider restoring from an earlier backup that predates the compromise.
Cannot access the admin dashboard
Use FTP or your hosting control panel's File Manager to rename the extensions directory. For WordPress, rename /wp-content/plugins/. For Joomla, rename the relevant folder within /plugins/. For Drupal, rename the relevant folder within /modules/. Disabling all extensions may allow you to log in.
Still Having Issues?
💻 Open a Ticket