Security

WordPress security checklist: 15 things that actually make a site harder to hack

How WordPress sites really get broken into, and 15 measures grouped by effort that deal with it: the 30-minute jobs, the half-day jobs, the ongoing routine and what to do in the first hour of a hack.

By the WE-DEV teamPublished 12 min read
An old iron padlock hanging from a hasp on a weathered red wooden door, photographed close up

A WordPress security checklist that works is shorter than most people expect. Keep everything updated, delete what you do not use, give every administrator a unique password and two-factor authentication, take automatic off-site backups you have restored at least once, and put a firewall in front of the site. Those five habits deal with most of the ways WordPress sites are broken into in practice. The other ten items below close smaller gaps. None of it needs a security consultant, and the first six jobs each take half an hour or less.

How WordPress sites really get hacked

Almost nobody is targeted personally. Automated scripts crawl the web looking for a known weakness, and they do not care whether the site belongs to a Leeds accountancy practice or a village cricket club. Any compromised site is useful to them for sending spam, hosting phishing pages or redirecting visitors to scam shops.

In the clean-ups we are asked to do, the way in is nearly always one of these:

  • An out-of-date plugin or theme. A flaw is found, the author publishes a fix, and details of the flaw become public. Sites that have not updated are then scanned for, often within days and sometimes within hours.
  • An abandoned plugin or theme. The author stopped maintaining it, so a flaw found later never gets fixed. Deactivated plugins count too, because their files are still on the server.
  • A weak or reused password. Attackers try username and password pairs leaked from other websites.
  • A nulled plugin or theme. These are pirated copies of paid products, offered free on download sites. Many contain a backdoor, which is the reason they are free.
  • Poor hosting isolation. On cheap shared hosting, or where several sites sit in one hosting account, an infection in one site can write files into the others. A forgotten test site is often how the main site gets infected.
  • Exposed backups and leftovers. A database export or a zip of the whole site left in a public folder, or a copy of wp-config.php saved as a .bak or .txt file, hands over every password without any hacking at all.

WordPress core itself is rarely the cause. It has a dedicated security team, and minor and security releases have installed themselves automatically by default for years. The yearly vulnerability reports from Patchstack and Wordfence, two firms that track WordPress security, say the same thing each time: the great majority of new vulnerabilities are in plugins, a much smaller share are in themes, and very few are in core.

The WordPress security checklist, grouped by effort

Fifteen measures in three groups, written for whoever looks after the site. Do them in order. Number one is worth more than numbers ten to twelve put together.

30-minute jobs

  1. Update core, plugins and themes. Go to Dashboard, then Updates, and clear the list. Then decide how updates will happen from now on: WordPress can update plugins and themes automatically, which suits simple brochure sites. For shops and heavily customised sites, we prefer a weekly manual run, with security fixes applied the same day they appear.
  2. Delete unused plugins and themes. Delete, not deactivate. Keep the active theme, its parent theme if it is a child theme, and one default theme as a fallback. While you are there, look at when each remaining plugin was last updated. If it has had no release for two or three years, plan a replacement.
  3. Use strong, unique passwords and a password manager. Unique matters more than complicated, because reuse is how most stolen passwords get in. The National Cyber Security Centre recommends a password manager, and three random words for the few passwords you have to remember. The same applies to the hosting control panel, SFTP, the database and the email account that receives password resets.
  4. Turn on two-factor authentication for every administrator. WordPress has no built-in two-factor login, so it needs a plugin: Two-Factor and WP 2FA are both free and well maintained, and the free Wordfence plugin includes it too. Save the backup codes somewhere safe when you set it up, or a lost phone will lock you out. A stolen password on its own then stops being enough.
  5. Limit login attempts. By default WordPress lets anyone guess passwords for as long as they like. A plugin such as Limit Login Attempts Reloaded, or the equivalent setting in Wordfence, locks out an address after a handful of failures. Add your own office IP address to the allow list so you cannot lock yourself out. It does nothing about a correct password stolen elsewhere, which is why items three and four come first.
  6. Cut the number of administrator accounts. Open Users and filter by Administrator. Most small business sites need one or two. Remove accounts for former staff and previous agencies, and replace any shared “admin” login with named accounts so you can see who did what.

Half-day jobs

These need access to the hosting account. If nobody in the business is comfortable editing wp-config.php, hand this part to a developer.

  1. Set up automatic off-site backups and test a restore. Back up the files and the database every day (more often for a busy shop), keep at least 30 days of copies, and store them somewhere other than the web server: cloud storage, or a backup service that is separate from the hosting account. A backup on the same server is lost along with the site, and can be read by whoever broke in. Then restore one to a test location. Until you have done that, you do not know whether you have a backup.
  2. Put a firewall in front of the site. There are two sensible routes. Wordfence runs inside WordPress and blocks requests that match known attack patterns; the free version gets new firewall rules and malware signatures 30 days after paying customers do. Cloudflare sits in front of the site as a proxy and filters traffic before it reaches your server, provided the DNS record is set to Proxied; its free plan includes a basic set of managed rules. Many sites use both. A firewall buys time between a flaw being announced and you updating. It does not make updating optional.
  3. Fix file permissions and disable the file editor. The usual settings are 644 for files and 755 for folders, with wp-config.php tighter still (WordPress.org recommends 440 or 400; some hosts need 600 or 640). Nothing should be 777. Then add define('DISALLOW_FILE_EDIT', true); to wp-config.php. This removes the theme and plugin editor from the dashboard, so someone who gets into an administrator account cannot paste malicious code straight into your theme. They could still upload a plugin, so this slows an attacker down and does not stop one. It is also worth blocking PHP files from running inside the uploads folder.
  4. Force HTTPS and add security headers. Every page, including the login screen, should load over HTTPS, with HTTP redirecting to it. Certificates are free on almost every decent host. Then add the standard response headers: Strict-Transport-Security, X-Content-Type-Options, a frame restriction and a Referrer-Policy. These protect your visitors’ browsers from certain tricks, such as your site being framed inside someone else’s page. They do not stop anyone breaking into WordPress. A full Content-Security-Policy is fiddly on a typical WordPress site, so treat it as a project of its own.
  5. Disable XML-RPC if nothing uses it. XML-RPC is an older way for outside software to talk to WordPress. It gives attackers a second login door that many login-protection plugins do not cover, and its pingback feature has been abused to attack other sites. Jetpack, the WordPress mobile app on some set-ups and some older integrations still rely on it, so check first. If nothing does, block xmlrpc.php at the server or the firewall.
  6. Reduce the noise, and be honest about what that achieves. Moving the login page to a different address, hiding the WordPress version number and changing the database table prefix are often sold as security. They add very little. A vulnerable plugin is just as vulnerable behind a renamed login page. What a custom login URL does do is stop most of the automated guessing that fills your logs, and quieter logs make real problems easier to spot. Do it for that reason, after everything above.

Ongoing

  1. Keep an update routine, with staging for the big ones. Pick a day each week. Read the changelog for anything marked as a security release and apply those first. For major versions of WooCommerce, a page builder, a membership plugin or PHP itself, update a staging copy of the site first and click through the checkout and the forms before touching the live one. Our article on what a WordPress maintenance plan should include covers the hours this takes.
  2. Set up monitoring and alerts. At minimum: uptime monitoring, an email when a new administrator account is created or a plugin is installed, a scheduled malware scan, and a check that last night’s backup ran. Send the alerts to a mailbox somebody reads. Verify the site in Google Search Console too, because Google reports hacked content there.
  3. Name the person responsible. Most hacked sites we see had no owner. The agency assumed the client was updating it, and the client assumed the host was. Write down who updates, who checks backups, who receives alerts and who to ring when something breaks. One name each.

What each measure protects against, and what it costs

Costs are approximate and for software only. Most of the list is free; what it takes is time.

MeasureWhat it protects againstEffortCost
UpdatesKnown flaws in core, plugins and themes30 minutes, then weeklyFree
Removing unused plugins and themesFlaws in code you are not even using10 minutesFree
Unique passwords and a password managerLogins with passwords leaked from other sites30 minutesFree to a few pounds a month per person
Two-factor authenticationStolen or guessed administrator passwords15 minutes per userFree
Login attempt limitsAutomated password guessing10 minutesFree
Fewer administratorsDamage from any one compromised account15 minutesFree
Off-site backups and a tested restoreLosing the site for good2 to 3 hoursFree to roughly £10 a month
Firewall (Wordfence or Cloudflare)Common automated attacks and known exploits1 to 2 hoursFree tiers; paid plans from around £100 to £250 a year
File permissions and no file editorThe easiest route to code changes from a compromised admin account1 hourFree
HTTPS and security headersIntercepted logins; some browser-side attacks on visitors1 to 2 hoursFree
Disabling XML-RPCOne route for password guessing and pingback abuse15 minutesFree
Custom login URLLog noise and wasted server load, not break-ins15 minutesFree
Update routine with stagingUpdates being skipped because the last one broke something30 to 60 minutes a weekStaging is included with many hosts
Monitoring and alertsA compromise going unnoticed for weeks1 hour to set upFree tiers suit most small sites
A named ownerEveryone assuming someone else is doing itOne conversationFree

If you would rather hand over the half-day group, it is typically six to eight hours of work on a straightforward site. At our WordPress development rate of £50 an hour, that is £300 to £400, plus VAT at 20 % (£60 to £80), so £360 to £480. You can book the time through hourly hire, and unused hours do not expire.

What to do in the first hour if your site is hacked

The usual signs: visitors are redirected elsewhere, Google shows a warning, the host suspends the account, or an administrator appears whom nobody recognises. Work through these steps in order.

  1. Isolate the site. Put it into maintenance mode, restrict access to your own IP address, or ask the host to do so. If it is a shop, stop taking orders.
  2. Do not just delete everything. It destroys the evidence of how they got in. Take a full copy of the files and the database as they are, and ask the host for the access logs before they rotate away.
  3. Change every credential, from a device you trust. All WordPress administrator passwords, the hosting control panel, SFTP or SSH, the database password, and the security keys and salts in wp-config.php, which logs everybody out. Reissue any API keys stored on the site, such as payment keys.
  4. Restore or clean. If you have a backup from before the break-in, restoring it is fastest. The difficulty is knowing when the break-in happened, since malware often sits quietly for weeks. If you cannot be sure, clean instead: replace core, every plugin and every theme with fresh copies from the original source, then check the uploads folder for PHP files, the user list, scheduled tasks, .htaccess, the mu-plugins folder and the database for injected content.
  5. Find the entry point. A restored site still has the hole that let the attacker in. Compare your plugin versions against published vulnerabilities and search the access logs around the first suspicious change. Then update everything before the site goes back online.
  6. Consider your data protection duties. If the site holds personal data (customer orders, enquiry form entries, user accounts) and that data may have been accessed, altered or lost, you may be dealing with a personal data breach under UK GDPR. The Information Commissioner’s Office says a reportable breach must be notified within 72 hours of your becoming aware of it, unless it is unlikely to result in a risk to people’s rights and freedoms, and that affected people must be told without undue delay where the risk to them is high. Whether yours is reportable depends on the facts. The ICO website has a self-assessment tool and a helpline, and you should record the incident and your reasoning either way. This is general information, not legal advice.

If the site shares a hosting account with others, assume they are affected until you have checked them. Our guide to choosing hosting for a small business explains what proper isolation between sites looks like.

What security plugins cannot do

A security plugin is worth installing. It is also the most oversold item on this list.

  • It cannot fix a vulnerable plugin. A firewall rule can block the known way of exploiting a flaw. The flaw remains until the plugin is updated or removed.
  • It cannot tell a thief from you when the thief has the right password and there is no second factor.
  • It runs inside the thing it protects. A plugin-based firewall is PHP code within WordPress. An attacker who manages to run their own code on the server can switch it off.
  • It sees only WordPress. A weak hosting password, an infected neighbouring site in the same account or an outdated server are out of its sight.
  • Its malware scanner misses things. New or well-hidden malware gets through, so a clean scan is not proof of a clean site.
  • It is not a backup, and it is not a person reading the alerts.

Installing two or three security plugins together does not add protection either. They overlap and slow the site down. Choose one and configure it properly.

When to get outside help

Most small sites can cover this list in-house with a developer brought in for the half-day jobs. Get help sooner if the site takes payments, stores health or financial information, or has custom code that nobody has reviewed. For those, a professional test is the next step, and our guide to website penetration testing in the UK explains what one covers and when it is worth paying for.

We are based in London and look after WordPress sites for businesses across the UK, from hardening and clean-ups to ongoing care through our cybersecurity services. If your site has been hacked, or you would like someone to go through this checklist against it and tell you what is missing, get in touch and tell us what you are seeing.

Frequently asked questions

Is WordPress secure?

WordPress core is well maintained and is rarely the way attackers get in. Most compromises come from out-of-date or abandoned plugins and themes, weak or reused passwords, pirated plugins and poorly isolated hosting. A WordPress site that is kept updated, with two-factor authentication and tested backups, is a reasonable choice for most businesses.

Do I need a security plugin for WordPress?

It helps, but it is not the first thing to do. Updates, unique passwords, two-factor authentication and off-site backups matter more. A plugin such as Wordfence adds a firewall, login limits and scanning on top of those. It cannot fix a vulnerable plugin or stop someone who logs in with a stolen password and no second factor.

How often should I update WordPress plugins?

Check weekly, and apply security releases as soon as you see them, ideally the same day. Simple sites can turn on automatic plugin updates. Shops and heavily customised sites are safer with a manual weekly run, testing major versions on a staging copy first.

Does changing the WordPress login URL make the site more secure?

Not in any meaningful way. It cuts down automated password guessing against the default login page, which keeps logs quieter and saves server resources. It does not protect against a vulnerable plugin or a stolen password, so treat it as tidying up and not as a security measure.

How do I know if my WordPress site has been hacked?

Common signs are visitors being redirected to other sites, a warning in Google results or in the browser, unfamiliar administrator accounts, new files you did not upload, spam being sent from the server, or the host suspending the account. Google Search Console reports hacked content it detects under Security issues.

Do I have to report a hacked website to the ICO?

Only if personal data was involved and the breach is likely to result in a risk to people. Under UK GDPR, a reportable personal data breach must be notified to the ICO within 72 hours of your becoming aware of it. The ICO website has a self-assessment tool to help you decide, and you should keep a record of the incident whether or not you report it.

WE-DEVUK software and web development agency. We build websites, custom software, mobile apps and online shops, and write these guides from the projects we run every week.

Photo: Arkadiusz Gąsiorowski via Unsplash

Read next

Ready when you are

Tell us what the business needs.

A developer replies within one working day. Fixed price or hourly, your choice — and the code is yours.