Secure WordPress - More SecurityWhat is the easiest and most effective way to protect WordPress against hacker attacks? There are already many in-depth articles and different approaches to WordPress security and how to secure WordPress. This article is about creating significantly more security with little effort.

This blog post is intentionally kept short. Anything that does not help much, is too complicated, or is hardly feasible without specialist knowledge has been deliberately left out.



WordPress security - effective measures for enhanced protection

To run WordPress securely, maintaining the system is above all very important. Regular updates, especially installing security-critical updates as quickly as possible, are clearly a top priority. Someone should always keep an eye on it.

Securing WordPress - what does that actually mean?
Before we get to the advanced security measures, here is a brief summary of the basics:

  • Strong passwords (admin account, FTP/SSH, database, hosting control panel).
  • Enforce HTTPS/SSL for the entire site.
  • Install as few plugins and themes as possible (delete unused ones).
    • Only obtain themes and plugins from secure/original sources.
  • Regular backups (e.g. via "UpdraftPlus Backup Plugin").
  • A secure hosting environment.
    • Multiple WordPress installations should definitely run isolated, each under its own system user (-> prevents mass hacks).
      Simple hosting packages in which separation is not possible are unsuitable for hosting multiple sites.
  • Secure devices from which the website is accessed.

Beyond these basic things, the following measures have proven effective for further hardening.

This makes a great deal of sense, especially for the very dynamic and extensive /wp-content directory. Injected PHP code and backdoors are effectively dealt with this way.

Suppose a hacker had placed backdoor code under
https://www.webseite-bereinigen.de/wp-content/plugins/akismet/wrapper.php
, then this file cannot be accessed when the wp-content directory is secured (403 - Forbidden). The same applies to all other files located deep within wp-content or otherwise injected in any way.
In the past, there have been attacks on plugin vulnerabilities that could even be fully blocked by .htaccess protection alone.
See WP File Manager and Contact Form 7 vulnerabilities.

The WordPress directory itself - secure wp-content

The .htaccess instructions can simply be copied into a newly created file or into an existing /wp-content/.htaccess file. In very rare cases, additional exceptions may be necessary. If something has not yet been covered here, please use the comment function below.

Protect the upload folder

The /wp-content/uploads folder can also be protected separately with a .htaccess file. PHP files have no place there in principle - so all .php calls should be blocked. The /wp-content/.htaccess already covers the uploads directory as well - but if that protection should ever be lost (accidentally deleted), this extra layer of protection can do no harm.

2b) Nginx configuration for wp-content protection

The .htaccess concept is supported only by the Apache web server. Unfortunately, Nginx configuration can only be adjusted with a few hosting providers.



NinjaFirewall LogoThe plugin "NinjaFirewall" is recommended as a highly effective and high-performance firewall. Unlike other solutions, there are no data protection concerns here - the firewall does not phone home. In addition, NinjaFirewall is one of the most performant firewalls, since it does not flood the database with log entries, as Wordfence does, for example.

New security rules are made available to all users free of charge. By default, it checks hourly whether there are updates that protect against new types of hacks.
Another useful feature is email notifications about pending security updates.



Current WordPress hacks are often also linked to unwanted or stolen admin user access - logins via /wp-admin or wp-login.php followed by malicious plugin/theme uploads.

When it comes to securing the WordPress login even further, you can either use NinjaFirewall's login protection (there is a menu item for this) or hide the login - simply change the login URL.
Another solution for greater security is the still not very common two-factor authentication in the WordPress environment.

4a) Set up two-factor authentication and enforce it for admin users

Fingerprint Login Protection

WebAuthn - passwordless login as a 2FA alternative

A modern way to log in without entering a password directly is the WebAuthn standard (a FIDO2 project of the W3C).

Instead of a password, Apple's Touch/Face ID, Windows Hello (PIN, facial recognition) and the biometric screen lock on Android can be used for authentication.
Once set up, the sign-in method can be selected as primary in the user settings, ensuring fast, convenient and secure login.

WPS Hide Login

As a second option, it can certainly make sense to hide the login completely. Of course, this is less useful if there is a frontend login (such as the customer login in the shop).

The plugin "WPS Hide Login" is suitable for renaming the login. After activation, a custom login URL can be set at the bottom of Settings -> General - for example /admin-in.
As a result, wp-login.php and /wp-admin can no longer be accessed when logged out. Accordingly, login attempts via the standard URLs will no longer happen at all.

In many hacks in the past, plugins/themes were uploaded. Many logs show entry via wp-login.php / wp-admin.
Default passwords / privilege escalation / session hijacking or cookie stealing are the causes.
Securing the login using one of the methods suggested here puts a stop to that.


Anyone who wants to deal with the topic of WordPress security in more detail can find a 7-part article series on it here: https://www.kuketz-blog.de/basisschutz-wordpress-absichern-teil1/

In summary, maximizing security is not rocket science - securing WordPress for advanced users - thanks above all to NinjaFirewall.

Additional offers

Customers about us

„The conversion of our Joomla website from PHP 5.3 to PHP 7 was super fast, affordable, and with impeccable results. Very good and friendly communication.“
– H. Bergmann

„Within one day, everything was done extremely professionally and extremely quickly. Very trustworthy. Excellent. 5 stars“
– Fernando V.

„I was unable to help myself, but here I found the expertise needed to get everything cleaned up again. Necessary updates and backups were carried out, everything was extremely affordable, fast, and good!“
– Klaus-Peter

„The site looks great – everything as before – and on PHP 7.2 – I am impressed - many heartfelt thanks!“
– Dr. Ingo Wuddel

„Since we run an online shop, it was very important to us that our site was quickly available again with full functionality for our customers. All work is carried out extremely quickly to our complete satisfaction.“ – Löwen Handels GmbH

„Very fast, reliable, and effective handling of the problem. In addition, I was given tips and Strato-specific information to reduce the risk of the problem recurring.“
– Heino B.

„The contact was exceptionally friendly, and some cosmetic additional work was taken care of on its own - as if it were completely natural. I am relieved and very grateful.“
– R. Mayer

„Great. In an absolute emergency, after 2 domains were blocked by Strato due to a hacker attack, both domains were initially temporarily back online the same day.“
– I. Radchenko

„Excellent service. Problem solved within 18 hours. We are delighted. Thank you very much 🙏“
– Tien Sy Vuong

Website-Bereinigung.de support service Google Reviews

Contact options

This email address is being protected from spambots. You need JavaScript enabled to view it.
Contact form

Schedule a call
+49 (0)2406 969796
Mon. - Fri. | 9 am - 9 pm