Skip to main content

Insanely Useful Tips to Prevent a WordPress Hack

December 5, 2021 – Lucy Manole
wordpress hack prevention tips

Insanely Useful Tips to Prevent a WordPress Hack

So, you’re one of the unlucky ones whose website has been hacked. You scramble around to find a solution with Google and don’t really find anything useful. The problem is the source is not always accurate and can often be outdated. 

And you’re not the only one facing this issue! 

Whether you’re a beginner at WordPress or a seasoned veteran who has created thousands of WordPress websites over the years—it’s still possible that your website could be hacked. 

Security plugins might not always be enough to keep your site safe from hackers, so it’s essential to take preventative measures before it’s too late. And since many SaaS-based companies also use WordPress to power their blogs, these tips apply to them as well. 

This article will go over several methods to keep your WordPress website protected from hackers, which are easier than you may think.

  • Install the latest WordPress version

Start from the basics. Install the latest WordPress version so that you can fix bugs. As per stats, 30.95% of Alexa’s top 1 million sites have outdated version 3.6 of WordPress installed. It makes the sites vulnerable. 

The updated version of WordPress will have new features, and it brings with it bug and security fixes. As per the official WordPress release, WordPress 5.8.1 is available now. The latest version is a security and maintenance release. It features 60 bug fixes as well as three security fixes.

  • Stick to a secure hosting provider

Good and reputed hosting providers offer security protection so that your site information is kept safe. 

Prior to settling for a website host, make sure to: 

  • Check the security measures they offer
  • Identify the manner in which they supervise their server network 
  • Check the way they use to respond to different security breaches.

WordPress site owners who have a shared hosting plan are more vulnerable to hacking. It gives hackers a chance to use other sites on the same server and access yours.

A dedicated server is costly but the most secure option. If you have high traffic levels or have stored sensitive info on your site, consider going for it.

Look for these security features in a host:

  • Server-level firewalls
  • DDoS protection
  • Malware scanning
  • Backups
  • Up-to-the-minute operating system, software and hardware, and more.
  • Implementing premium security plugin

Implementing a premium security plugin is crucial to protect your WordPress site from getting hacked. Go for security plugins with good ratings, such as Sucuri, iThemes Security, Wordfence, and so on. It can hold true especially for SaaS-based websites that need to have stringent security check

premium security plugin prevent a WordPress hack

The most common features of a security plugin include: 

  • A firewall that blocks mistrustful traffic
  • Brute-force defense to secure against multiple login attempts
  • A scanner to scan your themes, files, and plugins for any security issues
  • IP and user black-listing
  • Malware scanning feature
  • Tool to generate a strong password 
  • Two-factor authentication


  • Use strong passwords

If you look at the statistics, 8% of WordPress sites are hacked because of weak passwords. Anyone with a bit of tech knowledge can execute a brute force attack employing hacking tools. 

Thus, it is crucial that you maintain strong passwords and change them regularly. Avoid the most commonly used passwords such as 123456 and qwertyuiop or your date of birth or pet’s name.

USA Top 20 prevent a WordPress hack


Generate a password that has letters (upper and lowercase), numbers, and symbols. Your password should be at least 15 characters. Also, see that you are not repeating the password. 

Consider using free online password generators or paid services such as LastPass and DashLane. The tools will not only help you to generate solid passwords but store them for you.

  • Keep your themes and plugins updated.

A study found that WordPress plugins were responsible for 52% of WordPress vulnerabilities. In another study, 11% of WordPress vulnerabilities were credited to WordPress themes.

You might have seen that your smartphones and other devices get regularly updated. And with it, you get enhanced features, bug fixes, and security fixes.   

It is the same with your WordPress plugins and themes. Keeping them updated will lessen security risks as the WordPress team is working round the clock to fix security issues.  

To ensure that the updates don’t create trouble like plugin conflicts or causing your site to break, run a test with each update in a staging environment.

What’s more? Obtain your plugins only from reputed sources, and always remove plugins and themes that you don’t use. Remember, too many plugins and themes will slow down your site loading speed as well.

Consider getting in touch with a WordPress website development company to get the best out of your WordPress site.

  • Implement security through obscurity

To implement security through obscurity, you can hide your login URL. Though it sounds simple, it can be an effective security measure to safeguard your site from brute force attacks.

This works because hackers usually implement bots that are built to attack a website with a particular setup. Since they target your login page, the bots will go to the next site if they can’t find your URL.

You can hide your WordPress login page by altering the default URL. Or use a plugin such as WPS Hide Login to change it.

  • Disable file editing

A WordPress hack happens when a hacker exploits code and inserts malicious code into your website. The single most important thing you can do to prevent a WordPress hack is to disable file editing.

There is a code editor in WordPress that lets you edit your website files via your dashboard. Though it is a helpful feature, keeping it turned on will increase the chances of your site getting hacked. 

To stop the code editor, add the code below into your wp-config.php file:

// Disallow file edit


define( ‘DISALLOW_FILE_EDIT’, true );

Alternatively, you can disable PHP file execution in your /wp-content/uploads/ folders. To do that, open Notepad – or a similar text editor – and paste:

Files *.php>


deny from all


You can save this as .htaccess and then upload the file to the /wp-content/uploads/ folders to stop hackers who try to make backdoor attacks on your PHP execution.

Consider hiring WordPress website development services to create a secure WordPress website. 

  • Update themes and plugins

One of the leading causes of a site getting hacked is having an outdated plugin.

Aside from plugins not updated to the latest version, plugins with known vulnerabilities, outdated themes, and plugins that require weak passwords all provide opportunities for malicious attacks.

To allow WordPress to update all plugins, enable the auto-update feature automatically. In some cases, an updated plugin may not be compatible with other plugins. However, the positives outweigh the negatives.

If you own a site that doesn’t change often, it is best to enable the auto-update feature.

  • Keep your databases secure and isolated.

Your database has all the info about your site, making it irresistible to hackers.

Hackers can run automated codes for SQL injections to hack your site database. If you are using a single server to run several sites, it puts all your sites at risk.

To prevent your database from getting hacked, use separate databases for each site and let separate users manage them. In other words, every website should be allowed its own database and user.

Also, consider canceling all database privileges apart from ”data read” and ”data write” from users whose work is to upload data and install plugins.

Another great tip is to change the prefix of your database and rename it to misdirect the hackers. Even though it will not stop WordPress hacking by itself, the hackers can’t jump to the next WordPress site if any databases are hacked.

  • Take regular backups

It is all too common nowadays to hear about a hacker who has broken into an account because account owners failed to take backups of their files. If you are running any type of WordPress site, it is important that you take backups in case something happens to your site. You could be just the next victim.

Backing up your website will not prevent hacking. However, it’s one of the most important steps to take in case your site gets hacked.

When you make regular site backups, you will be able to restore your site again quickly whenever necessary. 

Backing up your WordPress site will depend on your hosting. You can ask your hosting provider to include backups as part of the package.

Or you can even talk with a WordPress agency or install a backup plugin. There are various backup plugins, such as UpdraftPlus, that let you automatically back up into the cloud directly to Dropbox, Google Drive, Amazon S3, email, and more. 

updraft plus prevent a WordPress hack


WordPress recommends keeping at least three backups and storing them in three different places. You can keep them in forms, like CD/DVDs, thumb drives, hard drives, web disk, e-mail account, and so on, to prevent issues in case one backup becomes corrupted.


The fact that WordPress has a huge amount of power and flexibility has a flipside to it – a bad user can easily use the platform as his weapon to attack other websites. Since WordPress is an open framework, it’s not hard to find code samples on how to break into sites. 

If your site was hacked, the damage could range from defacing your site to installing spamming software. So make sure to follow this article and use these tips mentioned to prevent a WordPress hack.

Post by Lucy Manole
December 5, 2021