Skip to content
Daleel Web

WordPress

WordPress security basics: the habits that stop most attacks

Security is risk reduction, not perfection. Learn the core WordPress habits: updates, strong passwords with two-step login, trusted plugins and backups.

By Daleel Web Editorial TeamPublished 2 min read
A padlock over a WordPress dashboard

No WordPress site is perfectly secure, and the official documentation says so plainly: security is risk reduction, not risk elimination (WordPress documentation). The goal is to make your site a harder target and to recover quickly if something goes wrong.

Know who is responsible for what

Your host looks after the server and network. You look after the application: WordPress itself, your theme, your plugins and your passwords. According to the same documentation, hacks are most often traced to the application, not the infrastructure. A good host discusses its security features openly, runs recent stable server software and offers reliable backup and recovery.

Keep everything updated

  • WordPress core. Older versions are not maintained with security updates. Once a fix is released, the details of the flaw are effectively public, which makes old versions easier to attack. Automatic updates exist, so use them.
  • Plugins and themes. Update them too, and delete any you do not use.
  • Source. Download WordPress only from wordpress.org, and get plugins and themes from the WordPress.org repository or well-known companies, not from random "free premium" copies.

Use strong passwords and two-step login

Avoid passwords built from your name, username, company or website name, dictionary words, short passwords, or only numbers or only letters. Let a password generator create one. WordPress also shows a strength meter when you change it.

An administrator account can install malicious code that endangers the whole server, so also turn on two-step authentication. WordPress core does not include it, so you add it with a plugin or your identity provider. Our login protection guide covers this in more detail.

Limit what an attacker can do

  • Use SFTP, not plain FTP, if your host supports it, so your password is not sent in the clear.
  • Disable file editing in the dashboard. Adding define( 'DISALLOW_FILE_EDIT', true ); to wp-config.php removes the theme and plugin editor. The documentation notes it will not stop file uploads, but it may stop some attacks.
  • Lock down file permissions. Files should be writable only by your account, with wp-content as the usual exception.
  • Be careful with plugins that execute code from the database or that ask for write access to your files.

Consider a firewall

Firewall plugins and services filter bad traffic before it does damage. Some work inside WordPress, others at the server, and others sit in front of your site as a reverse proxy. They help, but they do not replace the basics above.

Keep tested backups

If the worst happens, a backup you can restore gets you back online. See our WordPress backup guide.

Checklist

  • WordPress, plugins and themes updated
  • Unused plugins and themes deleted
  • Strong, unique admin password and two-step login on
  • SFTP used instead of FTP
  • File editing disabled in wp-config.php
  • Backups taken and a restore tested

Frequently asked questions

Is my host responsible for my WordPress security?

Only partly. The WordPress documentation explains that hosts are generally responsible for the infrastructure, not for the application you install. Updates, passwords and plugins are your side.

Should I turn on two-step login?

The WordPress documentation recommends enabling two-step authentication in addition to a strong password, because an administrator account can be used to install malicious scripts.

Is a security plugin enough on its own?

No. Firewall plugins and services help filter attacks, but they sit on top of the basics: updated software, strong passwords, trusted plugins and tested backups.

Sources & references

  1. WordPress Developer Resources: Hardening WordPress