Hacker attack on a WordPress site - ways to prevent

print · Время на чтение: 11мин · - · Опубликовано · Обновлено

playListen to this article

How to protect your WordPress site from hackers?

A hacker attack on a WordPress site is possible? Are you worried that hackers are attacking your WordPress site? I wish you weren't worried, but the truth is that WordPress websites are constantly being attacked by hackers. This is mainly due to its popularity as WordPress powers a third of all websites on the internet.

While WordPress itself is a secure website building platform, it doesn't work on its own. You need plugins and themes to run a WordPress site. Plugins and themes often contain vulnerabilities that hackers use to break into websites.

Once they access your website, they perform all sorts of malicious activities such as stealing confidential information, defrauding customers, and displaying illegal content. Meanwhile, your site may be marked with a warning in search results, blacklisted by Google, banned from Yandex, or even blocked by your web host. All this leads to loss of visitors and income.

While WordPress developers keep the platform secure, WordPress site owners also need to take action on their own. In this article, we will discuss the most common attacks on WordPress sites and the preventive measures you can take against them.

The content of the article:

Why is WordPress a popular target for hackers?

Why is WordPress a target for hackers?

WordPress is a website building platform that allows anyone to create websites without knowing how to code. What's more, WordPress is free. As a result, today the platform serves more than 1.4 billion active sites.

The flip side of all this is that WordPress websites are more targeted than websites built on any other platform.

Now there are several ways in which hackers can get into your site. I've narrowed down the list to the 5 most common ones. I'll explain what's going on and how you can protect your WordPress site from it.

The 5 most common attacks on WordPress sites

1. Vulnerable plugins and themes

WordPress site is created using three elements: core installation, themes and plugins. All three elements can make a site vulnerable to hacking.

For many years, there were no major vulnerabilities in the core of WordPress. It is supported by a team of highly qualified and experienced developers. They work hard to ensure the platform is completely secure, so you have nothing to worry about.

However, WordPress plugins and themes are created by third-party developers, and they create WordPress vulnerabilities quite often. When developers discover any vulnerability, they promptly fix it and release an updated version.

You, the site owner, need to update to the latest version and your site will be secure. It is important to install these security updates immediately. This is because when the developers release an update, they also reveal the reasons behind the update. Thus, the vulnerability is announced to the public.

This means that hackers now know that there is a vulnerability. They also know that not all site owners update their sites right away. So once they know a plugin or theme is vulnerable, they program bots and crawlers to crawl the web and find sites that use them. Knowing exactly what a vulnerability is allows them to easily exploit, hack and inject malware such as wp feed malware etc.

How to protect your site from vulnerable plugins and themes

  • Use only verified themes and plugins found in the WordPress repository or such marketplaces.
  • Check the list of plugins regularly and keep only the ones you use. Delete everything that you don't need or is inactive.
  • Scan your topic regularly. Ideally, you should only keep the theme you actively use.
  • Never use pirated themes and plugins. They usually contain malware that will infect your site.
  • Make sure you recognize all plugins and themes on your site. Sometimes hackers install their own plugins and themes that have website backdoors installed. This gives them secret access to your site.

2. Brute force attacks

To login to your WordPress site, you need to enter your login credentials i.e. username and password.

Often WordPress site owners use usernames and passwords that are easy to remember. Many WordPress users keep the default username "admin". Common passwords include "password123" or "1234567". Hackers are well aware of this and attack the login page of WordPress sites.

WordPress admin login page. (login, email, password).

They create a database of commonly used usernames and passwords. They then program bots to target WordPress sites and try out different combinations from their database.

If your login credentials are not secure, there is a high chance for bots to guess them and hijack your site. This is known as a "brute force attack" and they are estimated to have 10% success!

How to protect your site from brute force attacks

There are several steps you can take to protect your site from a brute force attack:

  • By default, your WordPress username is admin. You can change it from admin to something more unique. Use a strong WordPress password. I suggest using a passphrase in combination with numbers and symbols like Birdgfydhfgyysr143%.
  • Use unique credentials that you have not used on other websites.
  • Limit the number of login attempts to your site. This means that a WordPress user will only have a limited chance of entering the correct credentials, such as 3 attempts or 5 attempts. After that, they will need to use the "forgot password" option. You can install a security plugin and it will automatically secure your login.
  • Use two-factor authentication, which requires the WordPress user to enter their credentials along with a one-time password that is generated on their smartphones or sent to a registered email address.

3. Injection attacks

Almost every website has an input field such as a contact form, a site search bar, or a comment section that allows visitors to enter data. Some websites also allow visitors to upload documents and image files.

Typically, this data is received and sent to your database for processing and storage. These fields need to be properly configured to validate and sanitize the data before it enters your database. This ensures that only valid data is received. If these measures are missing, hackers take advantage of this and inject malicious code.

Let's take the example of a WordPress site that has a contact form. Ideally, this form should accept a name, email address, and phone number.

Contact form on a WordPress site. Contact form on the page.

  1. The name field must accept only alphabetic characters.
  2. The email address field must accept a valid email address format, such as example@mysite.com.
  3. The phone number field must contain only numbers.

Now, if these configurations are not present, a hacker can insert malicious scripts such as:

String userLoginQuery = "SELECT user_id, username, password_hash FROM users WHERE username = '" + request.getParameter("user") + "'";

This is the code that will tell the database to perform certain functions. Thus, hackers can run malicious scripts on your site which they can use to take full control of your site. The most popular injection attacks against WordPress sites include SQL injection attacks and cross site scripting.

How to protect your site from injection attacks

  • Many injection attacks involve themes and plugins that allow visitors to enter information on your site. I suggest using only proven themes and plugins. Then always update your plugins and theme.
  • Manage input fields and submit data. This is a technical issue and will require developer assistance.
  • Use a WordPress firewall.

4. Phishing and data theft

Visitors interact with your site in different ways. Some of them just read your blog posts, others contact you through your contact and so on. If you have an e-commerce site, many visitors buy products on your site. This means that they need to log into your website and enter their bank card details.

When someone enters credit card information into your site, they transmit and store the information on your site's server. This information can be intercepted during its transmission. In addition, bank card details can be stolen.

They can also infiltrate your website and impersonate you. They send emails or redirect visitors to other websites and trick them into disclosing personal and billing information.

How to protect your website from phishing and data theft

  • Use an SSL certificate. This will encrypt the data that is being transferred to and from your site. Even if a hacker intercepts it, he will not be able to use it, since he will not be able to decrypt it. This will also remove the WordPress site insecurity warning on your site.
  • Use a WordPress security plugin to get alerts about suspicious activity on your site. The plugin also blocks hacking attempts.

5. Cookie theft

Have you noticed that when you visit a website, your browser asks you to "remember me" or "save password"? This is to ensure that you do not have to enter your credentials every time you want to access a website. You can allow the browser to store login information.

Browsers can save this data thanks to cookies. Cookies are tiny pieces of data that record a visitor's interaction with a website. For example, if you run an online store, your site can track the customer's journey, such as what product they searched for and what they bought. This data is used in analytics, and advertisers adjust ads to the preferences of the visitor. Now cookies can also store bank details and personal information.

If a hacker can steal your website's cookies, they can access sensitive data about your business and your visitors. They may use this data to carry out their malicious activities, such as defrauding customers using their credit card details.

How to protect your site from cookie theft and session hijacking

  • Change your WordPress keys and salts regularly. Keys and salts provide secure encryption of information stored in browser cookies. This measure is technical in nature.
  • It is also recommended to install an SSL certificate to protect your website data.

This concludes the most common attacks against WordPress. Before we finish, I would like to show you a few WordPress security measures that will make your site more secure from such attacks.

How to protect your WordPress site from attacks?

While you can take certain steps to protect your website from certain attacks, there are some general security measures you can put in place on your website to better protect yourself. This is called WordPress tightening measures.

1. Disable the file editor

WordPress has a feature that allows you to edit theme and plugin files directly from the control panel. Many site owners do not need this feature, mostly developers use it. But if a hacker breaks into your wp-admin control panel, he can insert malicious code into your theme and plugin files. Thus, if you do not need this feature, you can turn it off.

2. Disable installation of plugins or themes

When hackers gain access to your site, they install their own plugins or themes. These plugins and themes are usually malicious and contain backdoors. This gives hackers secret access to your site.

Also, as I mentioned, vulnerable themes and plugins are the main cause of website hacks. If there are multiple users on your website, they may install an insecure plugin or theme. This may open your site to hackers. If you want to avoid this, you can disable the installation of plugins and themes on your site. If you don't install plugins and themes on your site regularly, you can disable the install option.

3. Limit login attempts

As I mentioned earlier, you can limit the chances for a WordPress user to enter the correct login credentials to login to the site. This eliminates the risk of brute force attacks.

4. Change security keys and salts

keys and soli encrypt information stored in your browser. This way, even if a hacker manages to steal your cookies, he won't be able to decrypt them. However, if a hacker gains access to these keys and salts, they can use them to decrypt the cookies. Changing keys and salts regularly can help prevent cookie theft.

5. Block PHP execution in unknown folders

There are only certain files and folders on your WordPress site that execute the code. Other folders only store information, such as the Downloads folder, which stores images and videos. However, when a hacker gains access to your site, they will paste the php code into random folders or even create their own folders. You can block such activity by disabling PHP execution in unknown folders.

The implementation of these measures requires technical knowledge. I don't recommend doing it manually. It is much safer and easier to use a WordPress security plugin that allows you to do this in just a few clicks.

In doing so, I will make sure that your WordPress site is protected from hackers.


There are many ways for hackers to get into your WordPress site, and they often come up with new ones! You need to take security measures to secure your website and keep it safe from hacker attacks.

Reading this article:

Thanks for reading: SEO HELPER | NICOLA.TOP

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 103

No votes so far! Be the first to rate this post.

Читайте также:

Добавить комментарий

Your email address will not be published. Обязательные поля помечены *

four × 3 =