What to Do When Your WordPress Site Gets Hacked? How to Fix It and Prevent Further Damage

The unfortunate truth of running a website is that it is possible for it to be compromised at any moment. We’ve had our WordPress account hacked a couple of times and understood how overwhelming it could be. Not to mention the effect it has on your readership and industry.

When your WordPress account is compromised, you risk losing your search engine rankings, exposing your followers to malware, seeing your image tarnished due to redirects to poor neighborhood websites, and, in the worst-case scenario, losing all of your site’s info.

Signs That The WordPress Site Has Been Hacked:

Hacker Sitting in a room

  • You are unable to log in.
  • Your website has been updated without your knowledge (for example, the homepage has been replaced by a static version, or new content has been added), or there is a notice that says “you have been hacked.”
  • Your website is redirected to a different website.
  • Google Chrome warns you that the site has been compromised as you look for it.
  • New pop-ups and advertisements.

How to fix a hacked site?

Free Emergency Recovery Script

ERS description

The Emergency Recovery Script (ERS) is a WordPress-independent PHP script that can restore a WordPress account under the most difficult circumstances. For example, if you can’t reach the admin panel if core files have been stolen, if you get the white screen of death, if you can’t log in for any reason, or if your website has been hacked.

You will usually address the issue with a plugin if WordPress seems to be running properly, and you can enter the admin. If you’re in a tight spot, though, ERS is the only option that can support you in minutes without requiring you to change any scripts, code something, or mess with the database. It will also stop you from reinstalling the whole site and possibly losing a lot of data.

How to install it?

Installing the ERS will save you a lot of time, particularly when you’re testing things out because you’re basically bound to make a mistake. Don’t panic if the site has already been hacked; it’s not the end of the work. There’s always a possibility you’ll be able to restore the site without messing anything up. Plus, it only takes a few moments to install the ERS.

Here’s how to do it: 

  • Save a new copy of the ERS file to your computer’s desktop.
  • You’ll be given a unique filename and password, which you can copy/paste somewhere secure.
  • To link to your site’s registry, use FTP or the cPanel file explorer.
  • Locate the WP root folder (the one containing the wp-login.php and wp-config.php files) and upload the ERS instance there.
  • Open the ERS at https://your-domain.com/unique-ers-filename.php, enter your password, and begin repairing the web.

WP Reset

WP Reset will save you if your account has been hacked or if you know you shouldn’t have done something that messed up your whole site by automatically creating a screenshot. You’ll like the fact that you can still return to a stable and running state of the website you had before an important update, installation, or after a specific period of time has passed.

Restore a backup

Backup dics

Now is the time to bring your contingency plan into motion if you have one. If you have access to a recent backup, restoring your WordPress site from a backup might be the quickest way to get back online. But make no mistake restoring your WordPress site’s backup may delete an infection and get you back online. However, it does not solve why you were hacked in the first place.

If the WordPress website has been hacked due to a loophole or security issue that has been abused, the next move is to try to find out what went wrong (if possible).

What if I don’t have a backup or can’t effectively recover my backup?

If you don’t have a backup that you can recover successfully, depending on the severity of the situation, you will want to place your WordPress website into maintenance mode to focus on restoring it while informing visitors that they can come back later.

WordPress returns to a 503 HTTP status code if you place it under maintenance mode using the wp maintenance()1 feature. A 503 status tells Google and other crawlers that something went wrong with the website and that they should return later.

Contact your hosting provider

Woman standing next to a server

In these types of cases, many successful hosting providers are extremely beneficial. Many knowledgeable people have likely dealt with similar issues previously and maybe well-equipped to assist. As a result, before doing anything of your own, contact your hosting company and follow their recommendations.

If your website is hosted on a public domain, you can still use this method to see if the hacker gained access to your website from another site on the same server. In this case, the hosting company will answer questions such as how the hack began and spread. There’s also a fair chance they’ll be able to tell you where the backdoor to the website is and how the hackers got through.

Hire a professional to fix it 

Laptop with code

If your website has been hacked or you just need it cleaned fast, getting professional assistance might be the best option. A compromised website just gets more vulnerable over time, but the sooner you can solve your problems, the safer your website will be.

If you don’t think yourself tech-savvy or just don’t want to screw things up when cleaning your site, this is most definitely the best option for you. In certain cases, it’s possible to make things worse rather than better, so if you’re not comfortable making drastic improvements to your site’s backend, it’s time to get help.

If you want to check out more about this topic, visit this link to learn more about these types of services and their prices.

Tips To Protect Your WordPress Site From Future Attacks

Keypad and a lock

Building a website takes a lot of time, resources, and effort. However, a malicious hacker will pull it down in a moment with a single attack. That’s why, in order to prevent anything like that from happening, here are a few tips for making your WordPress website extra safe.

WP Reset

WP Reset homepage

Many people have begun to focus on WP Reset when they need to start again, either to give their website a makeover or to clean up an unintentional disaster such as a hack. Not only can it quickly restore the archive of your website, but it can also assist you with cleaning out specific sections of the site.

The ability to generate database screenshots is another valuable aspect of this plugin that you won’t find in most others. What is the significance of this? Once you’ve created a database snapshot, you can use this plugin to restore the snapshot. That is, you can restore the website to a previous state, which would come in handy for developers, especially when your site has been hacked.

The outstanding service is perhaps the most praised aspect of this plugin. The WP Reset team is on hand to help users with any problems they can encounter. This is significant because, while WP Reset was created with developers in mind, anyone can use it. It’s ideal for cleaning up messes, finding and correcting small bugs, and speeding up production because it allows you to re-test code quickly.

Choose your web hosting company carefully

Make sure a reputable company hosts the website. This is due to the fact that they are in charge of keeping your website secure on their servers. You should conduct research and choose a hosting company with a solid reputation for security that goes above and beyond to safeguard your website on its servers.

You’ll be sharing disk space with hundreds of other customers if you get cheap hosting. This would not only cause the site to slow down, but it will also raise the likelihood of one of the other sites adding server insecurity. Cheap hosting companies are less likely to keep a close eye on server security or to assist you if your account is compromised.

Security Plugins to Keep The Website Secure

You can run a security check on your WordPress account at any time. Cleaning a compromised WordPress account without skilled assistance, on the other hand, can be challenging for non-technical users.

To defend your website from being compromised, you must adhere to security best practices. We’ve put them all together in an easy-to-follow WordPress protection guide for beginners. Let’s look at some of the best WordPress protection plugins and how they can help you keep your website secure.

WebARX

WebArx homepage

WebARX is a high-end website protection tool that works with every PHP app. WebARX is best known for its sophisticated endpoint firewall, which uses a cloud-based dashboard to give you full control of traffic between your websites. In reality, WebARX offers a controlled web application firewall that guards against plugin bugs, bot attacks, and fake traffic. Create your own firewall rules, harden your WordPress installation, backups, track uptime, and security problems, get updates, export reports, and much more with this plugin. It’s also effortless to set up.

Benefits of WebARX:

  • Firewall for advanced websites.
  • Virtual patching earns rules to patch plugin and theme vulnerabilities automatically.
  • Hardening the WordPress installation: 2FA, ReCaptcha, adding authentication headers dynamically, blocking brute-force attacks, changing wp-admin, adding cookies, and so on.
  • When a site goes offline, it gets slack and emails notifications.
  • Custom PDF protection files are available.

Wordfence

Wordfence homepage

Wordfence is a well-known encryption plugin for WordPress. They have a free version of their plugin that includes a powerful malware scanner, vulnerability detection, and threat evaluation functionality. The plugin can search your site for popular threats automatically, but you can also run a complete scan at any time.

If any signs of a security violation are found, you will be notified and advised on how to repair them. Wordfence also has a WordPress firewall built-in. This firewall, on the other hand, is enabled on your server right before WordPress is loaded.

Benefits of Wordfence:

  • For smaller websites, the free edition is sufficient.
  • When developers sign up for different site keys, they will save a lot of money.
  • It comes with a complete firewall package that includes software for nation blocking, manual blocking, brute force detection, real-time attack security, and a web server firewall.
  • You gain access to certain exclusive features, such as the ability to sign in with your phone and password auditing.

Security Ninja

Security Ninja homepage

Security Ninja is a company that has been around for more than seven years. It began as one of the first security plugins to be sold on CodeCanyon, but in 2016 it switched to a freemium platform. There are no more add-ons, and there are only two versions: free and standard. Over 50 protection checks are performed by the key module (which is the only one accessible for free), varying from testing files and MySQL permissions to different PHP settings.

Both user passwords are often subjected to a brute force search to root out accounts with bad passwords like “12345” or “password.” This aids in the security education of consumers. While it includes an auto-fixer module, it also includes a thorough description of each inspection, as well as code to manually fix the security problem for those who want to know what’s going on.

Benefits of Security Ninja:

  • Over 50 security checks are performed throughout the site by the security tester module (available in the free version)
  • The auto fixer module can resolve any found problems.
  • Scan the WordPress core files for credibility by contrasting them to a stable and up-to-date copy from wordpress.org.
  • Look for suspicious code and malware in plugins and themes.
  • Take advantage of a large number of known bad IPs and block them automatically.
  • From users signing in to configurations being updated, keep track of all that happens on the WordPress account.

Final Thoughts

It’s an awful feeling to get your website compromised. It means that your website is unavailable to visitors, which may have a negative effect on your market. It would necessitate quick intervention, which would affect your other activities.

You should be confident that if you take these measures and follow the tips and tactics outlined in this post, the risks of your website being compromised will be greatly diminished. And if it is compromised, you can be assured that no matter how powerful an attack your website is subjected to, you will still be able to return it to its former glory.