Black Friday

Your professional website for 360 USD: domain, hosting, maintenance and 2 email accounts included the first year.

No lock-in contract, with real people behind it. We want you to be a happy client.

Give your business its own place on the internet. This is the offer to get started.

See the offer

The Ultimate Guide to Shielding Your WordPress for FREE: How to Defeat Hacking Attacks with Cloudflare

Pantallas con codigo y monitorizacion de red, simbolo de ataques informaticos automatizados

WordPress powers more than 40% of all websites on the planet, and that popularity comes at a price: it is automated hacking’s favourite target. Hundreds of bots crawl the internet around the clock looking for outdated plugins, weak passwords and exposed login screens. Nobody needs to be after you personally for your site to get hit; it just needs to show up in the next sweep.

Hiring a professional firewall isn’t always within a small business’s budget. The good news is that Cloudflare offers a free plan that, properly configured, closes most of those doors at no cost. This guide explains how to set it up for WordPress and which settings actually make a difference against attacks.

Quick summary

  • Cloudflare Free sits between your visitors and your hosting: it filters traffic and hides your real server.
  • It doesn’t clean an already-infected site or stop someone who already has a stolen password. It complements maintenance, it doesn’t replace it.
  • With correct DNS, proper HTTPS, a login rule and Turnstile you cut out most automated hacking attempts.
  • It’s permanently free, not a temporary trial.

Why WordPress gets attacked so often

Being the world’s most used content management system is also WordPress’s biggest business vulnerability: any flaw in the core or in a popular plugin instantly affects millions of installs, which makes it a profitable target for automated attacks. Most of these attempts aren’t a person going after your site specifically. They’re scripts testing thousands of domains a day, looking for an old version, a plugin with a known vulnerability, or an admin account with a predictable password.

Several screens showing code and network monitoring, symbolising an automated cyberattack
Hacking against WordPress is mostly automated: bots crawling the internet looking for open doors.

That has a practical consequence: most incidents aren’t prevented by a miracle fix, but by closing the most obvious doors. Cloudflare’s free plan is exactly that, one less open door, applied before traffic even reaches your server.

What Cloudflare Free protects, and what it doesn’t

Cloudflare works as a reverse proxy: instead of traffic reaching your hosting directly, it passes through Cloudflare’s network first. That lets it filter abusive requests, serve certain files from its own infrastructure, and hide your server’s real IP address. The usual result is less load on your hosting and less bot noise reaching WordPress.

It’s worth being realistic about its limits, though. Cloudflare doesn’t automatically clean an already-infected site, and it won’t stop someone who already has your credentials. Nor can it fully block malicious code the browser downloads directly from a compromised third-party provider, such as an analytics or chat script: that risk is reduced by reviewing which integrations you actually use, not by a switch in the dashboard. There’s no button that “blocks AI” or hacking in general; what gets protected are access points, forms and abusive traffic patterns.

Before activating Cloudflare: get WordPress ready

Before touching your DNS, it’s worth getting the house in order. Cloudflare reduces the noise coming from outside, but your baseline security still depends on WordPress itself:

  • Make a full backup of files and database, and check that you can actually restore it.
  • Update the core, themes and plugins, checking compatibility first.
  • Remove plugins and themes you no longer use.
  • Use unique passwords and limit how many accounts have administrator rights.
  • Turn on two-factor authentication for administrators.
  • Confirm with your host that the server and PHP version receive security updates.

Also avoid installing several security suites at once: they overlap, eat up resources and make it hard to tell which one is doing what. Pick one tool per job and, if you schedule heavy scans, run them outside peak traffic hours.

Connect your domain to the free plan

  1. Add your domain to Cloudflare and select the Free plan.
  2. Go through the imported DNS records one by one; don’t assume it found everything.
  3. Keep your mail records (MX, SPF, DKIM, DMARC) and anything else your provider requires.
  4. Turn on the Cloudflare proxy (the orange cloud) on your web records, usually the root domain and www.
  5. Leave mail servers and any service incompatible with the HTTP proxy set to “DNS only”.
  6. Update your domain registrar’s nameservers to the ones Cloudflare assigns you.
  7. Once the dashboard confirms the domain is active, test both the website and your email.

If you already had DNSSEC enabled, coordinate the switch with your domain provider so you don’t leave incompatible validation records behind. Installing the official Cloudflare plugin for WordPress is optional: it’s handy for a few specific integrations, but it isn’t a requirement for turning the proxy on.

Basic configuration that makes a difference

Exact menu names shift from time to time, but these options always live inside the SSL/TLS, Security and Caching sections of the dashboard:

SettingStarting pointWhat to check
SSL/TLS encryptionFull (strict)That the server has a valid certificate for the correct domain name
HTTPS redirectEnabledNo redirect loops or mixed-content warnings
WAF (managed rules)Enabled, review the free rulesetLogged events and possible blocks on legitimate users
CachingDefault behaviourDon’t assume the full HTML is already being cached
Rocket LoaderDisabled at firstCompatibility with forms and payment gateways before turning it on
“Under Attack” modeReserved for a real incidentCan interfere with integrations and legitimate automated traffic

Full (strict) encrypts the connection all the way to your hosting and validates its certificate; it’s the recommended choice over Flexible, which uses HTTP towards the origin and is the most common cause of redirect loops in WordPress. Check first that your hosting has a valid certificate installed before switching to Full (strict).

Aisle of a data center with server racks
With the proxy turned on, your origin server stays hidden behind Cloudflare’s network.

Cloudflare’s free managed ruleset is a subset of its full protection; it doesn’t include every rule package from the paid plans, but it already blocks known attack patterns and common vulnerabilities. Rocket Loader, meanwhile, is a JavaScript loading optimisation, not a security measure: it needs testing before switching it on for a site with a store or critical forms.

Protect the login screen with a custom rule

Under Security > WAF > Custom rules, create a rule that challenges only visits to the login screen. If WordPress is installed at the domain root, the filter is:

(http.request.uri.path eq "/wp-login.php"
 and http.request.method eq "GET")

As the action, choose Managed Challenge. The idea is to challenge only access to the login page, not insert a challenge on every page. If your WordPress lives in a subfolder, adjust the path (for example, /blog/wp-login.php), and if you use a different login system, check its actual path before copying this example.

The Free plan includes a small number of custom rules, more than enough for the settings in this guide. Avoid applying a blanket challenge to the whole /wp-admin/ folder: WordPress uses paths like admin-ajax.php for functions that regular visitors also run, so a rule that’s too broad can break your own site.

Test logging in from a private window, password recovery and any customer login area before trusting the rule.

Limit login attempts

The free plan includes one rate limiting rule, ideal for slowing down brute-force attacks against the login page:

  1. Create a rate limiting rule with the filter http.request.uri.path eq "/wp-login.php".
  2. Count requests by IP address.
  3. As a starting point, try ten requests in ten seconds.
  4. On the Free plan, the block also lasts ten seconds.
  5. Watch real traffic for a few days and adjust the threshold if needed.

Ten requests is a starting suggestion, not a universal number: an office sharing a single IP, or a monitoring tool, might need a different threshold. Keep in mind this rule counts requests to the path, not wrong passwords, and that an attack spread across many different IP addresses needs extra layers of protection.

Turnstile: protect your forms without annoying people

Turnstile is Cloudflare’s alternative to traditional captchas: in most cases it verifies the visitor without asking them to pick out traffic lights or crosswalks. It has a free tier and can be used on a single form without routing your entire domain through Cloudflare’s proxy.

  • Create a widget for your authorised domains from the Cloudflare dashboard.
  • Add the keys to your form through a compatible plugin or custom function.
  • Keep the secret key on the server at all times, never in the browser.
  • Turn it on first for whichever form is getting the most abuse, not all of them at once.
  • Test valid submissions, errors, token expiry and mobile behaviour.

Verifying the token on the server is mandatory: showing the widget without checking the response leaves the protection half-done. Avoid loading it on pages that have no form at all: it adds work for the browser without adding anything in return.

Advanced settings, only if you need them

These settings aren’t essential for every website, but they’re worth knowing about:

  • Block XML-RPC if it isn’t used by your mobile app, Jetpack or remote publishing tools. Test your integrations afterwards: blocking it doesn’t disable the REST API or solve every attack vector.
  • Bot Fight Mode: turn it on carefully and test your scheduled tasks and integrations first; it isn’t a universal fix and it can’t be bypassed with a custom rule.
  • Restrict direct access to the server: ask your host to limit web ports to Cloudflare’s official IP ranges, so nobody can bypass the proxy by knowing the real IP. This is a server-level change, not a dashboard checkbox.
  • Keep an eye on third-party scripts: inventory your analytics, chat widgets, tag managers and A/B testing tools, and remove what you don’t use. A compromised external provider can serve malicious code to every site that trusts it, and no firewall fully prevents that; it’s reduced by reviewing which integrations you keep active.

Frequently asked questions

Is Cloudflare’s free plan enough for a small business?

For most small businesses, yes, combined with good WordPress maintenance. If you’re facing targeted attacks, run a high-traffic online store, or handle especially sensitive data, it may be worth evaluating a paid plan or a specialised protection service.

Do I need to install the official Cloudflare plugin?

It isn’t required. The proxy activates when you change your domain’s nameservers. The plugin adds specific features, like purging the cache from within WordPress, but it doesn’t replace that DNS change.

How often should I review this setup?

At minimum, a monthly review of versions, backups, users and plugins, plus an immediate check whenever a major security advisory is published. If you don’t have time for that, it’s exactly what a maintenance service covers.

Don’t let an attack catch you off guard

With S@Y Digital, technical WordPress maintenance is included in the first year, along with the design of up to 10 pages, your domain, hosting and two email accounts, for 360 USD with no long-term contract.