WordPress Under Attack: How to Protect Your Website Using Wordfence and Apache

IT Consultancy & Repairs, located in Crewe, servicing Cheshire and surrounding areas.

WordPress Under Attack: How to Protect Your Website Using Wordfence and Apache

WordPress security shield on laptop with Wordfence and Apache icons.

WordPress is one of the most widely used content management systems in the world, making it a frequent target for automated attacks. Fortunately, with the right security controls, many of these attacks can be stopped before they become a serious problem.

On 19 November 2026, my own consultancy website experienced repeated suspicious requests and failed authentication attempts originating from IP addresses geolocated to multiple countries. Using Wordfence and Apache, I investigated the activity, identified the targeted endpoint and implemented additional protection.

In this guide, I’ll explain what happened, what the logs revealed, and how you can improve the security of your own WordPress website.

Understanding the Threat: Why Attackers Target WordPress

Automated tools constantly scan the internet looking for WordPress installations, exposed login pages, vulnerable plugins and poorly secured authentication interfaces.

Common attack techniques include:

  • Brute-force attacks: Repeated attempts to guess account credentials.
  • Username enumeration: Discovering potential login usernames through public information or WordPress interfaces.
  • XML-RPC abuse: Using WordPress’s XML-RPC interface to attempt authentication or misuse exposed functionality.
  • Vulnerability scanning: Searching for outdated software, exposed files and known security weaknesses.
  • Distributed attacks: Generating requests from multiple IP addresses, making simple IP-based restrictions less effective.

A Real-World Example: What Happened to My Website?

During routine security monitoring on 19 November 2026, Wordfence recorded suspicious activity involving requests from multiple countries, including Malaysia, Indonesia, Chile, Mexico and South Africa.

One recorded event showed an authentication attempt using a username that did not exist on the website.

The important discovery was the requested endpoint:

/xmlrpc.php

This meant the attempt was targeting the WordPress XML-RPC interface rather than relying exclusively on the standard administration login page.

Some requests returned HTTP 200, others HTTP 403 or 503. An HTTP 200 response does not necessarily mean authentication succeeded: XML-RPC can return an application-level error within an otherwise successful HTTP response.

There was no evidence of successful unauthorised authentication in the records examined.

Step 1: Install and Configure Wordfence

Wordfence provides a web application firewall, malware scanning, login security and tools for monitoring suspicious activity.

  1. Open your WordPress administration dashboard.
  2. Navigate to Plugins > Add New Plugin.
  3. Search for Wordfence Security.
  4. Install and activate the plugin.
  5. Complete the initial configuration and enable the firewall.
  6. Follow the firewall optimisation process where supported by your hosting environment.

Ensure that Wordfence is updated regularly and that its firewall protection is active.

Step 2: Strengthen Login Security

Navigate to Wordfence > All Options > Brute Force Protection.

Review the available settings and consider:

  • Failed login limits: Restrict repeated unsuccessful authentication attempts.
  • Invalid usernames: Enable immediate lockouts for attempts using nonexistent usernames where appropriate.
  • Password strength: Require strong, unique passwords for privileged accounts.
  • Two-factor authentication: Enable MFA for all administrator accounts.
  • Login monitoring: Regularly review failed and successful authentication events.

Be careful when setting aggressive lockout thresholds, as legitimate users can accidentally trigger them.

For my own website, the administrator account is protected by a strong password and multi-factor authentication. The username used in the observed attacks was not a valid account.

Step 3: Investigate Suspicious Traffic

Wordfence’s Live Traffic feature can provide useful information about suspicious requests.

When investigating an event, examine:

  • The source IP address and approximate geolocation.
  • The URL being requested.
  • Whether the request was blocked or allowed.
  • The HTTP response code.
  • The username attempted, where recorded.
  • Repeated requests from the same address or network.

Remember that an IP address’s registered country, physical server location and geolocation database result may differ.

In this incident, three addresses within the same /24 network accounted for 30 recorded Wordfence blocks. A registration lookup identified the organisation responsible for the address range, providing a potential abuse-reporting contact.

However, network registration alone does not establish who operated the requests or whether the registered organisation was responsible.

Step 4: Disable XML-RPC If It Is Not Required

WordPress includes an XML-RPC interface, normally accessible through:

/xmlrpc.php

Some external publishing tools and integrations use this interface. However, websites that do not require XML-RPC can reduce their attack surface by disabling access.

On an Apache 2.4 server, an administrator can restrict access using the following directive in the appropriate virtual host or supported configuration context:

<Files "xmlrpc.php">
    Require all denied
</Files>

After updating the Apache configuration, validate it before reloading the service:

sudo apachectl configtest
sudo systemctl reload apache2

Important: Check whether Jetpack, remote publishing applications or other integrations depend on XML-RPC before disabling it. If you use managed hosting, your provider may offer a different method of blocking this endpoint.

Step 5: Verify That the Protection Works

Never assume a security change is working simply because the configuration has been saved.

First, check the endpoint:

curl -I https://yourdomain.co.uk/xmlrpc.php

Then perform a harmless POST request:

curl -i -X POST https://yourdomain.co.uk/xmlrpc.php \
  -H "Content-Type: text/xml" \
  --data '<methodCall><methodName>system.listMethods</methodName></methodCall>'

When access is denied at Apache, both requests should return:

HTTP/1.1 403 Forbidden

In my case, both tests returned HTTP 403, and the POST request received Apache’s standard forbidden-access page.

This provided evidence that the XML-RPC endpoint was no longer accessible through the tested requests.

Step 6: Consider Country and Network Blocking Carefully

Wordfence Premium includes country-blocking capabilities, which can reduce unwanted traffic from locations where a business does not normally operate.

However, country blocking has limitations:

  • Attackers can use VPNs and proxy services in permitted countries.
  • Legitimate customers may be travelling or using corporate VPNs.
  • IP geolocation information is not always accurate.
  • Blocking entire networks can affect unrelated users.

For these reasons, country blocking should be treated as an additional control, not a substitute for authentication security, patching or firewall protection.

Step 7: Keep WordPress and Its Components Updated

Wordfence is only one part of a wider security strategy.

Website owners should also:

  • Keep WordPress core, themes and plugins updated.
  • Remove unused plugins and themes.
  • Use reputable plugins with ongoing maintenance.
  • Maintain tested, recoverable backups stored separately from the website.
  • Protect hosting control panels and administrator accounts with MFA.
  • Review filesystem permissions and restrict unnecessary access.
  • Monitor security alerts and investigate unusual activity.

Where possible, security restrictions should be implemented at the web-server or network layer to prevent unnecessary requests from reaching WordPress.

Final Thoughts: Prevention Is Better Than Recovery

One of the most important lessons from this incident is that security monitoring must lead to practical action.

The investigation identified repeated requests to an authentication interface that the website did not need. Rather than simply blocking individual IP addresses, I restricted access to that interface and verified the result.

That is the difference between reacting to suspicious traffic and systematically reducing risk.

Cybersecurity does not mean eliminating every possible threat. It means understanding your exposure, implementing proportionate controls and continually improving your security posture.

If you’re concerned about the security of your business website or wider IT infrastructure, Paul Clarke IT Consultancy can help you identify risks, review existing protections and develop practical improvements.

Tags: , , , , , , , , ,

Follow by Email
FbMessenger