toolrota

WordPress security: 12 things to do so your site doesn't get hacked

WordPress powers a large share of websites, which makes it a target. Most attacks are stopped by simple measures. Here is the checklist.

Serkan Akyürek·Updated ·4 min read
WordPress security: 12 things to do so your site doesn't get hacked – Security & Web

WordPress is so widespread that it is an attractive target for attackers. The good news: most attacks come from simple causes like missing updates and weak passwords.

12 essential measures

  1. Keep everything updated. WordPress core, themes and plugins. Don't delay security updates.
  2. Delete plugins and themes you don't use. Deactivating is not enough; delete them.
  3. Choose plugins carefully. Prefer ones with many active installs, regular updates and good reviews. Never use "nulled" plugins of unknown origin; many contain backdoors.
  4. Use strong, unique passwords, generated by a password manager (see our password manager guide).
  5. Don't use the "admin" username. Attackers try it first.
  6. Add two-factor authentication (see our two-factor guide).
  7. Limit login attempts. Some security plugins block after many failed tries.
  8. Use HTTPS (see our SSL guide).
  9. Back up regularly and test restoring (see our 3-2-1 backup guide). Keep backups outside the hosting too.
  10. Restrict user roles. Authors and editors shouldn't be administrators.
  11. Turn off the file editor. Add define('DISALLOW_FILE_EDIT', true); to wp-config.php to disable code editing from the dashboard.
  12. Pick reliable hosting. Good hosting offers a firewall and automatic updates.

Do you need a security plugin?

There is no single "magic" plugin. Security plugins provide a firewall, malware scanning and login protection; they don't replace the basic measures above. Don't install two security plugins that do the same job.

Signs your site was hacked

  • Admin users you don't recognise.
  • Spam links or redirects added to the home page.
  • Strange foreign-language titles in Google.
  • Malware warning from your host.
  • A "This site may be harmful" warning in the browser.

What to do if hacked

  1. Tell your hosting company.
  2. Change all passwords (WordPress, hosting, database, FTP).
  3. Restore a clean backup; if there is none, clean the malicious files.
  4. Reinstall core and all plugins.
  5. Review admin users.
  6. Check the security issues section in Google Search Console and request a review.
  7. Find out how they got in, or it will happen again.

Maintenance calendar

  • Weekly: check updates.
  • Monthly: review users and plugins; test a backup.
  • Quarterly: review passwords and access.

Step-by-step example: setting up a new WordPress site securely (day one)

  1. Choose reliable hosting and use current PHP/WordPress versions (see our domain and hosting basics guide).
  2. Don't use the default "admin" user; set a unique administrator name and a long password (see our password manager guide).
  3. Add two-step verification to the admin account (see our two-factor authentication guide).
  4. Set up SSL/HTTPS and enter the admin area only over HTTPS (see our SSL and HTTPS guide).
  5. Delete unused themes and plugins; install only from trusted sources and actively developed ones.
  6. Turn on automatic updates as far as possible; important for small security releases.
  7. Set up backups (files + database) and try a restore (see our disaster recovery plan guide).
  8. Limit login attempts and restrict access to the admin area.
  9. Disable the file editor and set file permissions correctly.
  10. Set up monitoring (uptime and change alerts; see our website monitoring guide).

Checklist when choosing a plugin

CriterionWhat to look at
Last updateNot older than a few months
Active installationsWide use is a good sign
Reviews and supportAre problems answered?
CompatibilityTested with the current WordPress version?
Known vulnerabilitiesDoes it appear in security advisories?
NecessityCan't this be done without a plugin?

"Nulled" (pirated) themes and plugins can contain malicious code; never use them.

Frequently asked questions

Is a security plugin enough alone? No; current software, a strong password, backups and correct configuration are the foundation. A plugin is an extra layer.

How do I know I've been hacked? Unexpected redirects, admin accounts you don't know, spam pages and odd titles in search results are signs.

What should I do first if I've been hacked? Put the site in maintenance mode, change passwords, go back to a clean backup and close the hole (see our incident response plan guide).

How do I protect the admin panel? Use IP restriction, a login attempt limit and 2FA.

Is all this needed for a small blog? Yes; bots scan sites automatically; small sites are targets too.

Share
Published:
Author
Serkan Akyürek

Serkan Akyürek is the founder and author of toolrota; he writes step-by-step guides on Excel, AI, the cloud, personal finance and digital security.