Skip to content
WordPress Security Tips to Protect Your Website from Malware & Hackers

WordPress Security Tips to Protect Your Website from Malware & Hackers

By Nitin Shelar

Published:

Updated Date:

7 min read

Short on time? Send us your brief for a free proposal.Get a free proposal

WordPress powers a large share of the web, which makes it a constant target for automated attacks. Most compromises are not clever zero-days; they come from outdated plugins, weak or reused passwords, careless admin access and no backups. This guide groups the essential WordPress security measures into a practical checklist you can work through in an afternoon. Reviewed October 2026.

The short answer: keep everything updated, remove what you don’t use, protect logins (strong passwords, 2FA, limited attempts), add a firewall and malware scanning, lock down files, back up off-site, and monitor. Need help securing or cleaning a site? The Adroit’s WordPress team can audit it. Already hacked? See how to remove the Japanese keyword hack.

6security layers in this checklist
25practical actions
3copies of backups: local, off-site, tested
1habit that matters most: updating promptly

WordPress security checklist at a glance

Action Layer Effort
Update core, plugins and themes Basics Low
Delete unused plugins and themes Basics Low
Choose secure hosting and PHP version Basics Medium
Strong passwords and a password manager Logins Low
Two-factor authentication Logins Low
Limit login attempts / CAPTCHA Logins Low
Least-privilege user roles Logins Low
Disable file editing in the dashboard Files Low
Protect wp-config.php Files Low
Block PHP execution in uploads Files Medium
HTTPS everywhere Server Low
Firewall (WAF) and malware scanning Monitoring Low
Activity log and admin audit Monitoring Low
Automated off-site backups, tested restores Recovery Low

1. Basics: hosting, updates and cleanup

  • Choose reputable hosting with account isolation, a web application firewall, malware scanning, daily backups and a current PHP version. Managed WordPress hosts such as Cloudways, SiteGround and WP Engine include several of these, as do many good Indian hosts. Check what your plan includes.
  • Update promptly: core, themes and plugins. Most successful attacks use known vulnerabilities in outdated plugins. Enable auto-updates for core and trusted plugins, and test major updates on staging first.
  • Remove what you don’t use: deactivated plugins and themes can still be exploited. Delete them, and avoid “nulled” (pirated) premium plugins and themes, which often contain malware.
  • Choose plugins carefully: prefer actively maintained plugins with recent updates and good support, and keep the total number lean.

2. Protect logins and accounts

  • Use unique admin usernames: avoid “admin”. Create a new administrator and remove the default one after reassigning content.
  • Strong, unique passwords of 12+ characters, stored in a password manager such as Bitwarden or 1Password. Never reuse passwords.
  • Enable two-factor authentication (2FA) for every admin and editor, using an authenticator app. Plugins such as WP 2FA or the security plugin you use provide this.
  • Limit login attempts and add CAPTCHA (reCAPTCHA, hCaptcha or Cloudflare Turnstile) to login, registration and password-reset forms.
  • Least privilege: give each user only the role they need. Audit administrator accounts regularly and remove old ones.
  • Disable XML-RPC if you don’t use Jetpack or the mobile app, as it is a common brute-force target.

3. Harden files and the server

  • Disable the dashboard file editor by adding define('DISALLOW_FILE_EDIT', true); to wp-config.php, so a hijacked admin account can’t inject code through Appearance > Theme File Editor.
  • Protect wp-config.php: keep it out of the public web root where your host allows, or deny direct access at the server level. Set unique security keys and a custom database table prefix on new installs.
  • Block PHP execution in /wp-content/uploads/: uploads should hold media, not scripts. Your host or developer can add a server rule for this (the exact syntax depends on Apache, LiteSpeed or Nginx).
  • Use correct file permissions: commonly 755 for folders and 644 for files, with wp-config.php stricter (often 600 or 640). Don’t use 777.
  • Force HTTPS with a free Let’s Encrypt or host-provided certificate, and redirect all HTTP traffic with a 301.
  • Add security headers (such as HSTS, X-Content-Type-Options and a sensible Content-Security-Policy) via your server or CDN.

Server rules differ by environment, so test changes on staging and keep a backup. A misplaced rule can take a site offline.

Not sure which one fits your brief?

Tell us what you need for WordPress development and we will point you to the right fit, including when that is not us.

4. Firewall, scanning and monitoring

  • Use a web application firewall: a cloud WAF (Cloudflare, Sucuri) or a plugin firewall (Wordfence, Patchstack and others) blocks known attack patterns before they reach WordPress.
  • Scan for malware regularly with a reputable plugin or your host’s scanner, and enable alerts. Also scan for vulnerable plugins with tools like Patchstack or WPScan.
  • Log activity (logins, plugin installs, setting changes) with an activity-log plugin so you can trace problems.
  • Watch traffic and logs: sudden spikes, repeated failed logins or unknown files in wp-content are warning signs.
  • Don’t stack multiple security plugins that duplicate each other. Choose one well-maintained suite plus your host’s protections.

5. Backups and recovery

Backups are your last line of defence against hacks, bad updates and server failures.

  • Schedule automated daily backups of files and the database (UpdraftPlus, your host’s tool or similar).
  • Store copies off-site (cloud storage), not only on the same server.
  • Keep multiple restore points and test a restore periodically.
  • Write down the recovery steps and who is responsible.

6. Forms, comments and spam

Use CAPTCHA or honeypot protection on contact and registration forms, sanitise and validate inputs (a good form plugin handles this), and use Akismet or similar to filter comment spam. Spam links can harm SEO and expose visitors to phishing.

A note on robots.txt

robots.txt controls crawling, not security. It does not stop attackers (it can even reveal paths), and blocking areas like /category/ or setting crawl delays can hurt SEO; Google ignores the crawl-delay directive. Use it to manage crawling, and rely on the measures above for protection. See our technical SEO guide.

What to do if your site is hacked

  1. Don’t panic, and take a backup of the current state for forensics.
  2. Change all passwords (WordPress, hosting, database, FTP/SFTP, email) and invalidate sessions.
  3. Scan and clean infected files, remove unknown admin users and restore from a clean backup if available.
  4. Update everything and remove the vulnerable component that let attackers in.
  5. Check Google Search Console for security issues and request a review once clean.

Search results filled with Japanese text? Follow our guide to removing the Japanese keyword hack.

Conclusion

WordPress is secure when maintained. Update consistently, protect logins, limit what each user and file can do, add a firewall and scanning, and keep tested off-site backups. If you want an expert review or ongoing maintenance, contact The Adroit’s WordPress team. Also read how to choose a WordPress development company.

Get a WordPress security audit

FAQs

How do I secure a WordPress website?

Update core, plugins and themes, remove unused ones, use strong passwords with 2FA, limit login attempts, add a firewall and malware scanning, harden files, and keep off-site backups.

Why do WordPress sites get hacked?

Most often through outdated or vulnerable plugins and themes, weak or reused passwords, compromised admin accounts and pirated plugins.

Do I need a security plugin?

A reputable one adds firewall, scanning and login protection. Use one well-maintained solution rather than several overlapping plugins.

Is two-factor authentication necessary?

It is one of the most effective protections, because a stolen password alone can’t access the account.

Should I disable XML-RPC?

If you don’t use Jetpack, the mobile app or other remote publishing tools, yes. It reduces brute-force exposure.

How often should I back up WordPress?

Daily for active sites, with off-site storage and periodic restore tests.

Does robots.txt protect my site?

No. It only guides crawlers and offers no real security. Use proper access controls and a firewall.

What should I do first if my site is hacked?

Back up the current state, change all passwords, scan and clean the site or restore a clean backup, update everything and check Search Console.

Choosing a WordPress development partner?

Share your goals and budget range. We reply with a scoped plan and an honest view of fit, with no obligation.

SHARE ON

Author Nitin Shelar

Head of Technology

I am a Team Lead and UI Technology Analyst with around 12 years of hands-on experience in web and application development across Banking, Healthcare, and eCommerce domains. I have led cross-functional teams to design, develop, and deliver scalable, high-performance digital solutions. My expertise includes modern UI technologies, system architecture, and translating complex business requirements into user-centric applications. I consistently focus on quality, security, and performance to drive impactful digital experiences.

Hello!

We'd love to show you how you can get more traffic and leads

WhatsApp us