HomeSecurityIs there a way to clean WordPress from malware?

Is there a way to clean WordPress from malware?

If you are a WordPress user, you will surely know that it is often targeted by hackers. Whether you have been attacked yourself or you have heard about it from someone else, it does not really matter. The only thing that matters is finding a way to avoid the problems it causes.

But let's start with the basics. WordPress is an open sourcefor use as a content management system. Since the code is open, it gives hackers the ability to identify and exploit its vulnerabilities. Although its problems are fixed quite quickly, it often happens that its users neglect to perform updates and improvements.

WordPress

 

For this reason, there are security platforms that identify vulnerabilities in thesite and notify users. One such platform is Sucuri. Frequent updates of WordPress significantly reduce the risk of attacks. Thus, Sucuri, and other such platforms, will have access to your files and will detect any changes that are made.

To repair a WordPress site that has malware, your best option is to find a professional. In case you know how to handle it well, below we will see how to fix the damage yourself.

Let's make it clear early on that malware can be contained in WP files or DB content or both simultaneously.

  • We start by cleaning up the WP files.All WP files are located in a WP content directory.
  • Take a backup of wp-config.php, to use the DB details in the purge.
  • Delete all WP related files except wp content. Be careful not to delete robots.txt, .htaccess or other files/folders that are not related to WordPress.
  • Download the latest version of WordPress from https://wordpress.org/download/ , open it and upload it to server .
  • Now go to wp-content/plugins/ folder, mark all plugins, remove them all and download newer version and unzip it in plugins folder.
  • Go to wp-content/themes/ folder, remove all unused themes. If you have a backup of your currently active theme, you can also remove it and upload the backup. If you don’t have a backup, you can find the php/js files to see some lines of code that are repeated in most files. Find these lines throughout the theme and remove them carefully.
  • Go to the wp-content/uploads folder, it will contain non-executable files (eg: .jpg, .png, .gif, .pdf, .doc, .docx, etc.). So if you have any php/js files, open them and check. If these files contain unreadable code, remove them.
  • Now go to your website URL, it will ask you to reconfigure WordPress, you can choose to enter DB name, DB username, DB password to create new wp-config.php or repair the old wp-config.php file. This will complete your installation.

Now it's time for the DB content and its cleaning.

  • Go to the site and check the page source for suspicious code or redirect links
  • If the description box has unreadable content, then your DB is infected.
  • Look for these unreadable contents on multiple pages.
  • Download the DB sql file and look for the unreadable content, remove it or replace it with a blank character carefully.
  • Once downloaded, drop the DB tables and import this updated sql file.

Clean up the files or the Database or both.

To notify Google about fixing the site, try the following.

  • Log in to Google Search Console.

WordPress

  • Verify your domain.

WordPress

  • Then you will see the following notification

WordPress

  • Open the report and request a review. It usually takes days.

WordPress

The steps mentioned above are for experienced WordPress users. It is definitely not a good idea for a novice user to attempt them. In this case, we emphasize again that an expert will solve any problem for you.

Whatever you choose to do, your first step should be to seek resolution here.

📧
Subscribe to the SecNews Newsletter

The most important Security & Technology news in your Inbox.

SecNews
SecNewshttps://www.secnews.gr
In a world without fences and walls, who needs Gates and Windows

SEARCH

FOLLOW US

📧
Newsletter SecNews
The most important Security & Technology news in your inbox.

LIVE NEWS