1. Home
  2. Hosting & Servers
  3. Managed Wordpress Hosting
  4. How can I protect my wordpress website from hackers
  1. Home
  2. Hosting & Servers
  3. Managed Wordpress Hosting
  4. How can I protect my wordpress website from hackers

How can I protect my wordpress website from hackers

Every successful website must prioritize security. All sizes, reputations, and industries of firms are affected by this. Why? Read on.

There is no telling what an attacker might do with stolen information if they manage to obtain personal information about you or the users of your website. A security breach puts you at risk for identity theft, ransomware, server failures, and a long list of other things. Any of these activities, as you can understand, would be a waste of time, effort, and money and would not be good for the reputation of your company.

Your visitors expect it.

Simply put: Your visitors anticipate a secure website. If you can’t offer this basic service right away, you’ll damage your customers’ faith in you. You can make sure that your customers have a good experience with your company and will come back by gaining their trust.

Whether it’s their contact information, payment information (which necessitates PCI compliance), or even a simple survey response, it’s critical that your consumers have faith that their information is utilized and stored properly. The problem is that if your security procedures are effective, your customers won’t ever need to know. The majority won’t return if they ever hear unfavorable news regarding the security of your website.

Google likes secure websites.

On the search engine results pages (SERPs), everyone aspires to have a higher position. More visibility results in more visibility, which results in more visits. Making your site secure is fortunately one of the methods to increase the likelihood that Google will like it.

Why? because a searchable website is one that is secure. Google (and other search engines) visibility is directly impacted by WordPress security, and has been for some time. One of the simplest ways to improve your search ranking is through security. Our Ultimate Guide to Google Ranking aspects contains information on additional aspects that affect how Google ranks your website.

Everyone aims to be more prominent on search engine results pages.
It goes without saying that your top priority should be securing your internet properties. Your website needs to guarantee that when users access it, they are safe. However, before that, you might be asking if WordPress is safe?

Let’s take a look below.

How safe is WordPress?

The majority of people believe WordPress to be a secure content management system. If you don’t spend money on site security, it can be vulnerable to assaults like any other CMS.

There is no getting around the fact that WordPress-powered websites are frequently the target of hacks. A firewall firm called Wordfence reported blocking a staggering 18.5 billion requests for password attacks on WordPress websites in its report on the security of the platform. That amounts to about 20 billion attacks on WordPress-only websites.

Although these figures seem alarming, keep in mind that 43% of the internet was created using WordPress. Even after accounting for WordPress’ market share, approximately 20 billion attacks is still a lot.

The bad news keeps coming: according to the Common Vulnerability Scoring System, 8 out of 10 WordPress security concerns are classified as “Medium” or “High” severity hazards.

Let’s take a few steps back now that you are aware of the facts. Be aware that these figures are not actually WordPress’ fault before you hit the delete button on your account. Or, at the very least, not the WordPress software’s fault. So, as a responsible user, there are undoubtedly things you can do to support WordPress security initiatives.

WordPress websites has a huge security team of top researchers and engineers searching for holes in the software so they can patch any problems before a hacker can exploit them. Additionally, the security team releases software security upgrades on a regular basis. We’re covered as far as the WordPress core is concerned. WordPress sites may be trouble-prone because of how WordPress is made available to users.

WordPress is open-source software, as you may be aware. This indicates that anyone can distribute and alter the source code. Using open-source software has some advantages, like universal accessibility, limitless customizability, and optimization capabilities.

As a result, tens of thousands of developers have produced themes and plugins that greatly expand this platform’s capability. WordPress is known for its flexibility, which is a key component of its strength and popularity.

Of course, there is a price to pay for the freedom that WordPress provides. You are aware of several security problems if your WordPress site is badly configured or poorly maintained. WordPress grants its users a great deal of power, and great power entails great responsibility. Unfortunately, a lot of users ignore this obligation, and hackers are aware of this. They specifically target WordPress websites.
You may relax knowing that there is no such thing as 100% security, especially online. According to WordPress:

Security is risk mitigation, not risk aversion. It involves using all the reasonable measures at your disposal that help you to improve your overall posture and lower your risk of being a target and getting hacked.

Online threats are always a possibility, but you may take precautions to make them considerably less likely to happen. Since you’re reading this, it’s safe to assume that you’re concerned about security and are prepared to take extra measures to protect both you and your guests.

TLDR: If WordPress users take security seriously and adhere to best practices, then the platform is secure.

What are some common WordPress Security issues? 

So what happens if you choose not to safeguard your WordPress site despite the statistics? It turns out that a lot can occur. The most typical forms of cyberattacks that WordPress blogs experience are listed here.

Brute-Force Login Attempts

One of the simplest types of attack is the brute-force login attempt. It happens when a hacker utilizes automation to rapidly enter a large number of username-password combinations in hopes of guessing the correct credentials. In addition to logins, any password-protected information can be accessed by brute-force hacking.

Cross-Site Scripting (XSS)

The XSS attack comes next. This kind of attack takes place when a hacker “injects” harmful code into the website’s backend in order to steal information and disrupt the site’s functionality. The code can either be added to the backend using more complicated techniques or supplied merely as a response to a form that users can see. Be mindful of this.

Database Injections

This type of attack, also known as SQL injection, takes place when an attacker sends a string of malicious code to a website using user input, such as a contact form. The code is then kept on the website in the database. Similar to an XSS attack, malicious code is performed on the website to retrieve or compromise private data kept in the database.


Backdoors are another typical attack style. A backdoor is a file that has code in it that enables an attacker to access your website at any time by avoiding the regular WordPress login. Backdoors are frequently hidden among other WordPress source files by attackers, making them challenging for novice users to find. Attackers can create variations of this backdoor even after it has been removed and use them.

Although WordPress limits the file types that users can upload to lessen the likelihood of backdoors, be vigilant about protecting your website from this kind of assault.

Denial-of-Service (DoS) Attacks

The next form of assault is a frequent one called a denial-of-service attack. Attackers use this method to deny authorized users access to their own websites. DoS attacks are typically conducted by flooding a server with traffic until it crashes. When multiple machines simultaneously launch a distributed denial-of-service assault (DDoS), the consequences are amplified.


Phishing may already be known to you. It happens when an attacker contacts a victim while using the identity of a reliable business or service. Phishing attempts frequently demand personal information from the target, push them to download malware, or even direct them to a risky website that could damage their computer. A hacker who gains access to your WordPress account might even plan phishing assaults on your clients while pretending to be you. It’s not fantastic for your company’s reputation, as you could think.


When another website displays embedded content (often an image) that is hosted on your website without your consent, the content seems to be their own. This practice is known as hotlinking. Although hotlinking is typically illegal and causes the victim considerable problems because they must pay each time content is pulled from their server and shown on another website, it is more akin to stealing than a full-blown attack.

So how do these crimes get committed? A security breach on your website must be discovered. Once they do, they can start causing mayhem. When attacking WordPress sites, hackers frequently look out for the following vulnerabilities:

  • Plugins: The bulk of security holes in WordPress are caused by third-party plugins. Nevertheless, some of them are great add-ons that improve the usability of your website, so don’t discount them entirely; instead, exercise caution. Plugins are a typical way for hackers to interfere with the functionality of your website because they are developed by outside parties and have access to its backend.
  • Outdated WordPress versions: WordPress occasionally releases upgraded versions of its program to fix security concerns. Hackers usually target WordPress versions that have problems because when fixes are made public, the holes are made public as well. You can avoid this issue by maintaining an updated website
  • The login page: Any WordPress website’s default backend login page is the main URL of the site with “/wp-admin” or “/wp-login.php” appended to the end. This page is easily accessible to attackers who want to try a brute-force entrance. You can reduce the likelihood that a hacker would correctly guess your password by using a variety of complicated passwords.
  • Themes: Yes, even your WordPress theme might make your site more vulnerable to online threats. Older themes might not work with the most recent WordPress version, giving hackers quick access to your source files. Additionally, a lot of third-party themes do not adhere to WordPress’ code standards, leading to compatibility problems and similar risks. Do your research before adding a theme to your website, to reiterate.


How to Secure Your WordPress Site

  1. Secure your login procedures.
  2. Use secure WordPress hosting.
  3. Update your version of WordPress.
  4. Update to the latest version of PHP.
  5. Install one or more security plugins.
  6. Use a secure WordPress theme.
  7. Enable SSL/HTTPS.
  8. Install a firewall.
  9. Back up your website.
  10. Conduct regular WordPress security scans.
  11. Filter out special characters from user input.
  12. Limit WordPress user permissions.
  13. Use WordPress monitoring.
  14. Log user activity.
  15. Change the default WordPress login URL.
  16. Disable file editing in the WordPress dashboard.
  17. Change your database file prefix.
  18. Disable your xmlrpc.php file.
  19. Consider deleting the default WordPress admin account.
  20. Consider hiding your WordPress version.

Now that the terrifying part is over, let’s talk about the numerous measures you may take to lessen the risk of a cyberattack on your WordPress website.

The key to website security, and consequently WordPress website security, is adhering to recommended practices. While doing so greatly reduces your chances of experiencing a problem, it does not guarantee that you won’t ever have one. Strong passwords, two-factor authentication, SSL, and firewalls are a few recommended practices that are generally applicable to all websites, while some are specific to WordPress websites, such as adopting secure plugins and themes.

You must follow as many best practices as you can in order to keep your site secure. Let’s start with the best fundamentals. Then, if you are really worried about the security of your website, we’ll offer some additional precautions you may take if your site is particularly vulnerable or if you wish to take things a step further.

WordPress Security Best Practices

  1. Secure your login procedures.

This is the first step because it is so crucial to maintaining the security of your website. Keeping your accounts safe from fraudulent login attempts is the first and most important step in securing your website. How to do it:

  • Use strong passwords: Use secure passwords; as of this year, individuals are still using “123456” as a password, contrary to what we used to believe about the future of transportation. All users who have access to the WordPress site’s backend must log in with strong passwords. All other users could experience problems with just one weak password. Consider using one of our suggested password managers to create secure passwords and manage them for you.
  • Enable two-factor authentication: Users that utilize two-factor authentication (2FA) must confirm their sign-on with a different device. One of the simplest yet most powerful tools for protecting your login is this one, and it works. Adding two-factor authentication to WordPress is explained here.
  • Avoid making any account username “admin”: During a brute force login attempt, attackers will probably enter Admin as the initial username. Create a new administrator account with a different username if you’ve already created a user with that name.
  • Limit login attempts: You may safeguard your website by limiting the number of times a user can enter incorrect credentials. The CMS will lock users out if they try to log in too frequently, preventing a brute-force login. You might be able to get this taken care of by firewalls and some hosting firms, but you can also do it yourself by installing a plugin like Limit Login Attempts.
  • Add a captcha: You’ve probably encountered this security measure on many other websites if this sounds similar. They confirm that you are a real person in order to increase the security of your login. You can incorporate a captcha into your website using plugins. One that we suggest is reCaptcha by Google.
  • Enable auto-logout: Last but certainly not least, stay vigilant about logging out, especially if you’re using a public computer. Auto-logout prevents strangers from snooping on your account if you forget. To enable auto-logout on your WordPress account, try the Inactive Logout plugin.
  1. Use secure WordPress hosting.

Let’s move on to the topic of WordPress security and the part your hosting company plays in it. There are numerous things to consider when selecting the company that will host your website, but security should come first. Do your homework to find out more about the precautions the company takes to safeguard your information and quickly recover in the event of an attack.

  1. Update your version of WordPress.

WordPress software that is out of current presents a significant threat. Make sure to constantly check for WordPress updates and install them as soon as you can to close any security holes to prevent this problem.

Before updating WordPress to the most recent version, make a backup of your website and make sure all of your plugins are compatible with it. It’s possible that you’ll also need to update your plugins. To upgrade your WordPress plugins, you can refer to our instructions.


  1. Update to the latest version of PHP.

One of the most important things you can do to increase WordPress security is to upgrade to the most recent version of PHP. WordPress alerts you on your dashboard when an upgrade is ready, so keep an eye out. You will then be instructed to access your hosting account and upgrade to the most recent PHP version. Contact your web developer to upgrade if you are unable to log into your hosting account.

  1. Install one or more security plugins.

Fortunately, you don’t have to handle site security entirely on your own; you may rely on a security plugin. We strongly advise adding a few trustworthy security plugins to your website. (Stress the word respectable!)

These plugins take care of a lot of the hard labor associated with security for you, including checking your website for attempts at intrusion, changing source files that can leave it vulnerable, resetting and restoring the WordPress site, and preventing content theft like hotlinking. Several trustworthy plugins include practically every item on this list. Of course, if you’re utilizing HubSpot’s Content Management System, which includes malware scanning and threat detection within the platform, you won’t need to take this step.

Whether or not they are security-related, be sure the plugin(s) you choose to install are reputable and well-known. Prior to downloading anything that isn’t on this list, please use caution.

  1. Use a secure WordPress theme.

Just like you shouldn’t use a dubious plugin on your website, you should also refrain from using any WordPress theme that looks nice. Why? Because it might be dangerous, leaving your website vulnerable to serious problems. Select a theme that complies with WordPress standards to avoid vulnerabilities brought on by themes.

Copy the URL of your website (or the URL of any WordPress site or any theme’s live demo) into the W3C validator to see if your current theme complies with WordPress’ criteria. Find a new theme in the official WordPress theme directory if you discover that your current theme isn’t compliant. Each theme in this collection is secure to use with WordPress.

  1. Enable SSL/HTTPS.

With the use of SSL (Secure Sockets Layer), which encrypts connections between your website and visitors’ web browsers, you can make sure that no unauthorized parties may read the data sent between your website and their machines.

You must enable SSL on your WordPress website. If you utilize CMS Hub, SSL is already included in the system and is free, so you’re good to go. Using a dedicated SSL plugin or doing it manually depends on your use case if you’re using WordPress. It will improve SEO, but it will also have a direct impact on how visitors perceive your website. When a website doesn’t implement the SSL protocol, Google Chrome will even alert users, directly reducing website traffic.

Visit the homepage of your WordPress site to check if it adheres to the SSL standard. Your connection is encrypted using SSL if the homepage URL starts with “https://” (the “s” stands for “secure”). You’ll need to get your website an SSL certificate if the URL starts with “http://”.

  1. Install a firewall.

An automatic firewall keeps unauthorized traffic from accessing your network or system from the outside by placing itself between the network that hosts your WordPress site and all other networks. By removing a direct link between your network and other networks, they try to block harmful activity.

To secure your WordPress website, we advise adding a Web Application Firewall (WAF) plugin. Your website will have WAF built into the platform when using the CMS Hub. Consider carefully which kind of firewall and plugin will work best for your needs before making your decision, just like with everything else on this list.

  1. Back up your website.

Hacking is distressing. If you lose all of your data as a result, it seems much more distressing because it feels like a violation of your digital privacy. Making sure WordPress and your hosting company are backing up your website can help you prevent that from happening. You will be able to restore access to the data in the case of an attack (or any other incident) that results in data loss. We advise automatic backups as well. Check out our ranking of the top WordPress backup plugins.

  1. Conduct regular WordPress security scans.

Last but not least, we advise you to regularly audit your website. Try to do it at least once every month. And no, you don’t have to; several security plugins can complete the task for you. The seven WordPress scanner plugins we suggest are listed below.

Following the completion of these fundamental steps, you can proceed to more sophisticated actions to secure your WordPress website.

Advanced WordPress Security Best Practices

  1. Filter out special characters from user input.

There is a chance for an XSS or database injection attack if any area of your website allows users to submit a response, such as a payment form, contact form, or even a comment section on a blog post. Any of these text boxes could be used by attackers to inject malicious code, which would break your website’s backend.

This is bad because having these capabilities on your site is essential for collecting information from reliable people.

Make careful to remove special characters from user input before it is processed by your website and stored in a database to avoid this issue. A plugin can also be used to find malicious code. As an alternative, you may automatically filter out these characters using a WordPress form plugin.

  1. Limit WordPress user permissions.

WordPress websites frequently feature numerous user accounts. However, we advise modifying each user’s roles to restrict their access to only that which they require. Each user of WordPress can select from six different roles.

By restricting the number of users who have administrator privileges, you may lessen the likelihood that an attacker would brute-force their way into an admin account and minimize the harm that can be done if they do successfully guess a user’s credentials. To modify the user permissions for WordPress, refer to our tutorial.

  1. Use WordPress monitoring.

It’s crucial that your website has a monitoring system in place. This will notify you of any shady behavior that takes place on your website. Though ideally your other precautions would have stopped such behavior, it’s better to learn about it now rather than later. If there is a breach, you can use a WordPress monitoring plugin to receive an alert.

  1. Log user activity.

Here’s another strategy for anticipating problems before they arise: Make a log of every action visitors take on your website, and occasionally scan it for irregular behavior. By doing this, you can see any questionable activity by other users, such as password changes, changes to theme or plugin files, or unauthorized plugin activation or deactivation. Logs can help you fix a hack by indicating what went wrong and when it happened.

Not all password changes or file alterations are indicators that a hacker is on your team, though. However, it’s always a good idea to keep an eye on things if you’re hiring numerous external contributors and providing them access permissions.

Numerous WordPress logging plugins exist, including WP Activity Log and the free Activity Log plugin. Many WordPress plugins provide activity logs.

  1. Change the default WordPress login URL.

As we’ve already discussed, it’s too simple to find the default URL for every WordPress site’s login page. Fortunately, you can change it to increase your security. You can change the URL of this login page using plugins like WPS Hide Login.

  1. Disable file editing in the WordPress dashboard.

WordPress administrators can directly change the code of their files using the code editor by default. If an attacker manages to access your account, they will have a simple way to change your files thanks to this. You can disable this functionality yourself with a little light coding if a plugin hasn’t already done so. Add the following code at the end of the wp-config.php file:

// Disallow file edits

define( ‘DISALLOW_FILE_EDIT’, true );

  1. Change your database file prefix.

By default, the names of the files that make up your WordPress database start with “wp_”. You guessed it: By using this configuration, hackers can use SQL injections to find your database files by name.

There is a straightforward repair, which is good news. Simply substitute an alternative prefix, such as “wpdb_” or “wptable_,” for the current one. This can even be configured during WordPress CMS installation. You can rename these files if your site is already operational with this option. Since your database stores all of your content and a misconfiguration will cause your website to break in this situation, we advise utilizing a plugin to manage this procedure. Among the features of your desired security plugin, look for the option to alter table prefixes.

  1. Disable your xmlrpc.php file.

The WordPress CMS can communicate with third-party web and mobile applications via the XML-RPC protocol. Since the addition of the WordPress REST API, XML-RPC usage has significantly decreased. However, some people continue to use it to wage effective attacks on WordPress websites.

This is due to the fact that XML-RPC technology enables attackers to submit requests comprising dozens to hundreds of commands, making brute force login attempts more convenient. Because its requests include exploitable authentication credentials, XML-RPC is also less secure than REST.

You can disable the xmlrpc.php file if you’re not utilizing XML-RPC. Check to see if the file is being used on your website first. Use this XML-RPC validator to see if your website is currently utilizing the protocol by entering your URL. If not, a plugin like Disable XML-RPC-API makes it simple to disable this file. You might also be able to accomplish this using the security plugin for WordPress.

  1. Consider deleting the default WordPress admin account.

We’ve talked about modifying the default WordPress admin account’s “admin” username, but if you want to go a step further, you might think about eliminating this account entirely.

You can then make a new account with the same administrator rights. If you believe that your original admin username and password have been compromised and you wish to prevent it from happening again in the future, you should take this action.

  1. Consider hiding your WordPress version.

Hackers won’t be aware that your site is vulnerable if you hide the WordPress version. You must always update WordPress to the most recent version, as was previously discussed. However, it’s imperative to conceal the possible vulnerability if you haven’t had the chance to do so yet.

What To Do If You’re Hacked

Now that you’ve put some or all of the aforementioned protections into place, you want to be extra ready in case something goes wrong. Or perhaps something is not right. In either case, follow these steps:

  1. Remain calm.

It’s normal to feel anxious when a situation is unpredictable and you feel powerless to influence it. But it’s crucial to make an effort to maintain your composure. Unfortunately, even those who have taken great care to protect their website can have a security incident. Keep your composure so you can identify the cause of the breach and start fixing it.

  1. Turn on maintenance mode on your website.

It’s now time to restrict access to the website. By doing this, you can prevent attacks by keeping outsiders away. It is crucial that you wait to reopen your site until you are certain that everything is under control.

  1. Start creating an incident report.

The next step is to compile the information you’ll need for an incident report. These may finally serve as hints for resolving the issue. Be aware of:

  • When you discovered the problem.
  • What led you to believe you were attacked.
  • Your current theme, active plugins, hosting provider, and network provider.
  • Any recent changes you made to your WordPress site before the incident.
  • A log of your actions while finding and fixing the issue.

Update this document as more details become available.

  1. Reset access and permissions.

To stop additional website changes, you should update the passwords for all of your WordPress site’s accounts. After that, require any logged-in users to log off.

Since you can’t be certain of what the attackers were able to access outside of your WordPress site, it is strongly advised that all account holders replace the passwords on both their personal and work-related devices as well as their personal accounts. Although it is a pain, it can ensure that the attack’s impact is compartmentalized.

  1. Diagnose the issue.

In some circumstances, you can use a security plugin to conduct a manual search for the issue. However, based on the severity of the assault, you might need to employ a specialist to identify the problem and fix your website. Regardless of the approach you select, perform a security scan on your website and local files to remove any malicious code or files the attackers may have left behind and to replace any files that may have been lost.

  1. Review related websites and channels.

Are there any other platforms connected to your website where you have accounts? If so, you ought to take security measures to lock those up as well. Check to see if the hacker posted on your Instagram account on your behalf, for instance, if your website contains links to your Instagram account. You must also update the passwords for any connected accounts.

  1. Reinstall backup, themes and plugins.

Reinstall your theme and plugins, making sure they are secure before doing so. Restore the most recent backup made before the incident if you have one.

  1. Change your site passwords again.

There is no such thing as being too cautious when it comes to WordPress security. Your passwords have already been reset, but while you were troubleshooting, the credentials might have been compromised. It’s impossible to be too cautious. Consider making another change as a result.

  1. Alert your customers and stakeholders.

If personal information was obtained and released during the assault, you should strongly consider contacting your consumers after your site is back up and running. Although it’s the correct thing to do, be ready for backlash from customers.

  1. Check that your website is not blacklisted by Google.

Google might have blacklisted your website as a result of the attack. If so, Google will not-so-subtly alert consumers before they visit your website:

The majority of traffic to your genuine site will be scared away by blacklisting, even if it is vital to steer users away from bad websites. A free tool from Sucuri may check your website’s status on Google’s blacklist.

  1. Follow the best practices above.

You’ll feel more at ease if you take all reasonable preventative measures to lessen the likelihood of another attack. We can only pray that this won’t happen again. But even if it does, you’ll be far better prepared since you’ll know how to deal with everything much better.

Don’t take security for granted.

Regrettably, cybercriminals never stop learning new tricks to use a company’s web presence against them. Fortunately, security experts are constantly creating fresh ways to thwart them. We are all stuck in the center of this never-ending cycle of internet security. To give your clients one less thing to worry about, always consider their safety.

Updated on October 12, 2023

Was this article helpful?