How to secure a WordPress website?

  1. Keep the core, themes and plugins updated, and delete the ones you do not use.
  2. Use strong and different passwords, and two factor login for admins.
  3. Give each user the lowest role needed.
  4. Use HTTPS and the latest supported PHP version.
  5. Limit the login attempts, and do not use the username admin.
  6. Turn off the file editor: define( 'DISALLOW_FILE_EDIT', true );.
  7. Set the correct file permissions (755 folders, 644 files, 600 or 640 for wp-config.php).
  8. Take regular backups and test the restore.
  9. Download plugins and themes only from trusted places, and never use nulled ones.
  10. Use a security plugin or a firewall for scans and brute force protection.

You can check if your core files are changed:

Terminal output

$ wp core verify-checksums
Success: WordPress installation verifies against checksums.

More in WordPress Security.


Learn more about the similar topics:
Tutorials
WordPress Security
WordPress Data Validation, Sanitizing and Escaping
Exercises & Assignments
Save a plugin setting with a sanitize callback
Interview Questions & Answers
What is the recommended permission for WordPress files and folders?
What is the difference between sanitizing, validating and escaping in WordPress?
What is a nonce in WordPress?
How to prevent SQL injection in WordPress?
How to secure a WordPress website?