Secure WordPress - greater securityHow can WordPress be protected from hacker attacks in the simplest and most effective way? There are already many comprehensive articles and different approaches on the topic of WordPress security and how to secure WordPress. This article is about achieving significantly more security with minimal effort.

This blog post is intentionally kept brief. Anything that offers little benefit, is too complicated, or is hardly feasible without expert knowledge has been deliberately left out.



WordPress Security - Effective Measures for Enhanced Protection

To run WordPress securely, proper system maintenance is the most important factor. Regular updates, especially installing security-critical updates as quickly as possible, are clearly the top priority. Someone should always keep an eye on it.

Secure 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 instances should absolutely be isolated, each running under its own system user (-> prevents mass hacks).
      Basic hosting packages where this separation is not possible are unsuitable for hosting multiple sites.
  • Secure devices used to access the website.

Beyond these basic points, the following measures have proven effective for more advanced hardening.

This makes especially good sense for the highly dynamic and extensive /wp-content directory. Injected PHP code and backdoors are effectively shut down this way.

Assuming a hacker had placed code at
https://www.webseite-bereinigen.de/wp-content/plugins/akismet/wrapper.php
a backdoor script, this file would not be accessible if the wp-content directory is protected (403 - Forbidden). The same applies to all other files located deep inside wp-content or injected there in any way.
In the past, there have been attacks exploiting plugin vulnerabilities that could even be completely blocked by .htaccess protection alone.
See WP File Manager and Contact Form 7 vulnerabilities.

The WordPress directory in general - secure wp-content

The .htaccess directives can simply be copied into a newly created file or into an existing file at /wp-content/.htaccess. In very rare cases, additional exceptions may be necessary. If anything is still missing here, please use the comment function below.

Protect the upload folder

The /wp-content/uploads folder can also be protected separately with its own .htaccess file. PHP files generally have no place there, so all .php requests should be blocked. The /wp-content/.htaccess already covers the uploads directory as well - but if it should ever go missing (for example, if it is deleted by accident), this extra layer of protection certainly does no harm.

2b) Nginx configuration for wp-content protection

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



NinjaFirewall LogoAs a highly effective and high-performance firewall, the plugin 'NinjaFirewall' is recommended. 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 because it does not fill the database with log entries, unlike Wordfence, for example.

New security rules are provided free of charge to all users. By default, it checks hourly whether updates are available that protect against new types of attacks.
Another useful feature is email notifications for 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 a malicious plugin/theme upload.

When it comes to adding extra protection to the WordPress login, you can either use NinjaFirewall's Login Protection feature (there is a menu item for it) or hide the login by simply changing the login URL.
Another solution for greater security is the still not widely established 2-factor authentication.

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

Fingerprint as 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 Android’s biometric screen lock can be used here for authentication.
Once set up, the login method can be selected as the primary option in the user settings, enabling a fast, convenient, and secure sign-in experience.

WPS Hide Login

As a second option, it can definitely 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 a shop).

The plugin 'WPS Hide Login' is a good choice for renaming the login. After activation, you can define a custom login URL under Settings -> General at the bottom of the page - /admin-in, for example.
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 occur at all.

In many hacks in the past, plugins/themes were uploaded. Many logs show that access was gained via wp-login.php / wp-admin.
Weak 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.


If you would like to explore the topic of WordPress security in more detail, you can view a 7-part article series here: https://www.kuketz-blog.de/basisschutz-wordpress-absichern-teil1/

In summary, maximizing security is no dark art - WordPress security for ambitious users - thanks primarily to NinjaFirewall.

Additional services

What clients say about us

“Migrating our Joomla website from PHP 5.3 to PHP 7 was completed super fast, at low cost, and with a flawless result. Very good and friendly communication.”
– H. Bergmann

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

“I didn’t know how to help myself, but here I found the expertise needed to get everything cleaned up again. Necessary updates and backups were done, and everything was extremely affordable, fast, and good!”
– Klaus-Peter

“The site looks great – everything is just as before – and all under PHP 7.2 – I’m impressed - many heartfelt thanks!”
– Dr. Ingo Wuddel

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

“Very fast, professional, 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 especially friendly, and some additional cosmetic work was taken care of on their own initiative - as if it were only natural. I am relieved and very grateful.”
– R. Mayer

“Excellent. In an absolute emergency, when 2 domains were suspended by Strato due to a hacker attack, both domains were temporarily brought back online the very same day.”
– I. Radchenko

“Outstanding 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