How to secure a WordPress website against hackers

How do you secure a WordPress website? Keep WordPress, themes and plugins updated, remove anything you do not use, use strong passwords with two-factor login, install a security firewall, limit login attempts, and keep daily backups stored off the server. Most hacked WordPress sites are attacked through outdated plugins or weak passwords, so these basic steps prevent most problems. If a site is already hacked, clean it, close the entry point, and fix the spam pages in Google Search Console.

This guide covers how attacks happen, a hardening checklist and what to do after a hack.

How WordPress sites get hacked

  • Outdated plugins and themes: the most common entry point.
  • Nulled or pirated plugins: often include hidden malware.
  • Weak passwords and shared admin accounts: easy targets for brute-force attacks.
  • Old PHP versions and cheap hosting: missing security patches.
  • Unprotected forms and uploads: used to upload malicious files.

WordPress security checklist

  1. Update WordPress core, plugins and themes every week.
  2. Delete inactive plugins, themes and old admin users.
  3. Use strong unique passwords and two-factor authentication for every admin.
  4. Install a security plugin or firewall and limit login attempts.
  5. Change the default admin username and protect the login page.
  6. Use HTTPS everywhere and keep the SSL certificate valid.
  7. Set correct file permissions and disable file editing in the dashboard.
  8. Run the latest supported PHP version.
  9. Keep daily backups stored outside the hosting server.
  10. Monitor uptime and scan for malware every week.

Backups and monitoring

A backup is your safety net. Keep at least 30 days of daily backups in a separate location, test a restore every few months, and use uptime and malware monitoring so you hear about problems before your customers do. Our website maintenance checklist lists the weekly and monthly tasks.

What to do if your WordPress site is hacked

  1. Put the site in maintenance mode and change every password, including hosting and database.
  2. Restore a clean backup from before the hack, or clean the files and database.
  3. Find and close the entry point: update or remove the vulnerable plugin or theme.
  4. Remove spam pages and return a 410 status for spam URLs so Google drops them faster.
  5. Check Google Search Console for security issues and request a review when the site is clean.
  6. Submit a fresh sitemap and monitor indexed pages for a few weeks.

Signs your WordPress site may be hacked

  • Strange pages or Japanese or pharma keywords in Google results.
  • Redirects to other websites, especially on mobile.
  • New admin users you did not create.
  • Warnings in Chrome or Google Search Console.
  • A sudden drop in traffic or a slower site.

Security also affects SEO: hacked pages and spam can hurt rankings. See our technical SEO checklist, and if the site is old and hard to secure, read our website redesign checklist. For the bigger picture, see our UX design guide.

Frequently asked questions about WordPress security

Yes, WordPress core is secure when it is kept updated. Most hacks come from outdated plugins, themes and weak passwords.

Keep everything updated, remove unused plugins, use strong passwords with two-factor login, add a firewall and keep off-site backups.

Look for spam pages in Google, strange redirects, unknown admin users, browser warnings or a sudden traffic drop.

Restore a clean backup or clean the files, close the vulnerable entry point, change all passwords, remove spam pages and request a review in Google Search Console.

DH—Blog posts

More articles.

Insights from our team on SEO, paid ads, social media and web.