Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared hosting Managed WordPress Cloud hosting VPS hosting By reader location Hosting finder
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Blog Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Security · Guide

How to Secure a WordPress Site: A Prioritized Checklist

How to Secure a WordPress Site: A Prioritized Checklist

Short answer

To secure a WordPress site, update core, themes and plugins, use strong passwords with two-factor checks, limit login attempts, harden wp-config.php, set safe file permissions, add HTTPS, and keep tested backups off the server. Work in that order.

Key takeaways

  • WordPress 7.1.4 was released on 28 October 2026 as a security release, and only the most recent version is actively supported.
  • Set folders to 755 and files to 644, and keep wp-config.php at 400 or 440.
  • Changing the eight security keys and salts signs every user out at once.
  • Let's Encrypt certificates are free, last 90 days, and renew automatically.
  • Back up files and the database off the server, and test a restore before you need one.

What should you secure first on a WordPress site?

Start with updates, strong logins, and a backup, because those three steps close the most common ways in.

WordPress security is risk reduction, not risk elimination, according to the official hardening guide. No single setting makes a site safe, so work through the list in order and fix the high-impact items first.

The guide groups the work into three ideas: limit access, contain damage if someone gets in, and prepare to recover. That order shapes the table below, with the fastest wins at the top.

PriorityStepWhat it stops
1Update core, themes, and pluginsAttacks on known flaws in old code
2Strong passwords plus two-factor checksGuessed and stolen logins
3Limit login attemptsBrute-force password guessing
4Harden wp-config.phpStolen admin sessions and code edits
5Set safe file permissionsMalicious files written to the server
6Add HTTPS and security headersPasswords and cookies read in transit
7Add a firewall and scanningAutomated attacks and hidden malware
8Keep tested backups off the serverData loss after a hack

Do the first three rows before anything else. They take under an hour on most sites and cover the attacks the hardening guide names as most common: outdated software and brute-force password guessing.

How do you keep WordPress, themes, and plugins updated?

Update WordPress core, every theme, and every plugin as soon as a new version appears, because older versions get no security fixes.

The hardening guide is direct on this point: older versions of WordPress are not maintained with security updates. Once a fix ships, the details of the flaw are public, so sites still on the old version become easy targets.

WordPress 7.1.4 was released on 28 October 2026 as a security release, and WordPress.org says sites should update immediately, on its version 7.1.4 page. The same page states that only the most recent version of WordPress is actively supported.

Follow these steps to stay current:

  • Open Dashboard, then Updates, and install every core update shown.
  • Turn on automatic minor updates, which WordPress has offered since version 3.7, according to the hardening guide.
  • Update plugins and themes from the same screen, and delete any plugin or theme you no longer use.
  • Check the Site Health screen after each update round for warnings.

Delete unused plugins instead of leaving them switched off. An inactive plugin still sits on the server, and its files can still be reached if they hold a flaw.

How do you lock down logins and user accounts?

Give every account a long unique password, turn on two-factor checks for admins, and remove accounts nobody uses.

A stolen admin login is one of the worst outcomes in WordPress. The hardening guide warns that an attacker with an admin account can install scripts that compromise the whole server, so the login page deserves the most care.

The guide lists what to avoid in a password: your own name, a dictionary word, a short password, or a password made only of numbers or only of letters. Use a password manager to create and store a long random password for each account.

Add a second check after the password. The hardening guide recommends two-step authentication as an extra measure, and the guide to adding two-factor authentication to WordPress shows the setup steps.

Tighten the accounts themselves:

  • Never use admin as a username, since it is the first name attackers guess.
  • Give each person the lowest role that lets them do their job.
  • Delete old accounts from former staff or developers.
  • Change passwords right away when someone with access leaves.

Check the Users screen once a month. A site that collects extra admin accounts over time is a site with extra doors.

How do you harden wp-config.php?

Add three constants to wp-config.php: fresh security keys, a disabled file editor, and forced HTTPS for logins and the admin area.

The wp-config.php file holds the database password and the secret keys that sign login cookies. The wp-config.php handbook documents each constant below, so copy the lines exactly and place them above the line that reads “That's all, stop editing!”.

First, replace the eight security keys and salts with a fresh set from the official secret-key generator. The handbook says you can change these at any point to invalidate all existing cookies, which signs every user out.

Second, switch off the dashboard file editor:

define( 'DISALLOW_FILE_EDIT', true );

The hardening guide explains that the dashboard editor is often the first tool an attacker uses after logging in, since it allows code to run on the server. Disabling it removes that path.

Third, force secure logins:

define( 'FORCE_SSL_ADMIN', true );

The handbook says this constant keeps passwords and cookies from being sent in the clear on login and admin pages. It only works once a certificate is installed, so add HTTPS first.

How do you set safe file permissions?

Set folders to 755 and files to 644, keep wp-config.php at 400 or 440, and never use 777.

File permissions decide who can read, write, and run each file on the server. The hardening guide says to lock them down as much as possible and loosen them only when a task needs write access.

The guide gives a simple scheme: all files should be owned by your user account and writable only by you, except where WordPress itself needs to write. The wp-content folder is the exception, since uploads and caches live there and the web server must write to it.

Use these commands over SSH to fix permissions across the whole install, as shown in the hardening guide:

find /path/to/your/wordpress/install/ -type d -exec chmod 755 {} \;
find /path/to/your/wordpress/install/ -type f -exec chmod 644 {} \;

The same guide says wp-config.php should be readable only by you and the web server, which generally means a 400 or 440 permission. You can also move wp-config.php one folder above the web root, where browsers cannot reach it at all.

Check the permissions after any migration or restore. Moves between hosts often reset them, and a file left at 777 is an open door.

How do you add HTTPS and security headers?

Install a certificate, switch both site addresses to HTTPS, redirect all HTTP traffic, and add a Strict-Transport-Security header.

WordPress.org lists HTTPS support among its requirements, and the hardening guide calls for an HTTPS encrypted connection for admin work so passwords and cookies stay private. Without HTTPS, anyone on the same network can read login details.

Let's Encrypt issues free certificates that last 90 days and renew automatically through the ACME protocol, according to the Let's Encrypt documentation. Most hosts install one from the control panel, so check there before doing anything by hand.

Once the certificate works, open Settings, then General, and change both the WordPress Address and the Site Address from http:// to https://. Then add a server redirect so every old HTTP link lands on the HTTPS version.

Add a Strict-Transport-Security header last. MDN documents the header as a way to tell browsers to use HTTPS for a site, with a max-age value in seconds, on its Strict-Transport-Security page. A max-age of 31536000 covers one year and is the minimum for preload lists.

The guide to adding security headers to WordPress lists the other headers worth setting and where each one goes.

How do you add a firewall and malware scanning?

Put a firewall in front of the site to filter bad requests, then scan the files on a schedule so hidden changes get found.

A firewall blocks requests that match known attack patterns before WordPress has to handle them. The hardening guide describes three kinds: plugins that filter at the WordPress level, a web firewall on the server, and a cloud service that filters traffic before it reaches the host.

Cloud services such as Cloudflare and Sucuri sit between visitors and the server, and the hardening guide notes they also work as content delivery networks. A plugin firewall is easier to set up, while a server or cloud firewall catches attacks earlier.

The guide to setting up a web application firewall for WordPress compares the options and shows the setup steps for each type.

Scanning matters because a hack is not always visible. The hardening guide says an attack always leaves traces, either in the logs or on the file system, in the form of new or changed files. A scanner that compares files against the official versions finds those changes.

Run these checks on a schedule:

  • A daily malware scan of themes, plugins, and uploads.
  • A weekly look at the server access log for repeated failed logins.
  • A file check after every plugin or theme update.

Treat a scan alert as a job to finish, not a message to dismiss. Open the flagged file, find out what changed, and clean it before the next scan.

How do you back up a WordPress site so you can recover?

Back up the files and the database on a schedule, store copies away from the server, and test a restore before you need one.

Backups are the last line of defence, and the hardening guide treats them as part of security planning rather than an afterthought. A site with no backup has no safe way back after a hack.

The guide suggests keeping a set of timed snapshots of the whole install, files and database together, in a trusted location. That way a hack found days after it happened can still be undone with a copy from before the break-in.

The guide to backing up a WordPress site shows the setup for plugin backups, host backups, and manual backups.

Follow these rules for backups that actually work:

  • Keep at least one copy off the server, such as cloud storage.
  • Back up before every update, migration, or big change.
  • Test a restore on a staging copy at least once, so the first restore is not during a real outage.
  • Encrypt the backup or store it somewhere only you can reach.

A backup you have never restored is a guess, not a plan. Test it once and the whole checklist gets stronger.

How do you watch for signs of a hack?

Check the Site Health screen, the user list, and the server logs on a schedule, and act on anything you do not recognise.

Most hacks are found late, because nothing on the front of the site looks wrong. The hardening guide says logs show what was done, by which IP address, and when, including brute-force attempts, file changes, and odd requests.

The guide to running a WordPress security audit gives a full audit routine you can repeat each month.

Watch for these warning signs:

  • New admin users you did not create.
  • Posts, pages, or links you did not publish.
  • Plugins or themes you did not install.
  • A sudden drop in traffic or a warning in search results.
  • Files with recent change dates you cannot explain.

Check the audit log if your security plugin keeps one. It records logins, file edits, and setting changes, which is the fastest way to find out when a problem started.

What should you do after a security incident?

Take the site offline or into maintenance mode, change every password and key, clean the files, and restore from a known-good backup if needed.

Speed matters once a hack is confirmed, because every hour leaves the door open. Work through the steps in order and do not skip the password changes, since the attacker may still hold a valid login.

First, change the admin passwords, the hosting password, and the database password. Then generate fresh security keys and salts, which signs every user out at once.

Next, scan the files and remove anything the scanner flags. If the damage is wide, restore the files and database from a backup made before the break-in, then update everything before the site goes live again.

Finally, find how the attacker got in. Check the logs for the first odd request, update or remove the plugin or theme involved, and close the gap before reopening the site.

Write down what happened and what you changed. That note turns one bad day into a checklist that stops the same attack next time.

Frequently asked questions

What is the first thing to do to secure a WordPress site?

Start with updates, strong passwords with two-factor checks, and a backup. Those three steps close the most common ways in, and they take under an hour on most sites. Add the firewall, file permissions, and headers after the basics are done.

Does my host handle WordPress security for me?

No. WordPress core is kept up to date by its security team, but the site owner is responsible for updates, passwords, file permissions, and backups. The official hardening guide is clear that hosts cover the server while you cover the application.

Do I need both a firewall and a malware scanner?

A firewall filters bad requests before they reach WordPress, while a scanner looks for files that have already changed. Use both: the firewall stops attacks, and the scanner finds the ones that got through.

What should I do first after finding a hack?

Change every password and security key, scan and clean the files, and restore from a backup made before the break-in if the damage is wide. Then find how the attacker got in and close that gap before the site goes live again.

Can I secure a WordPress site without paying for anything?

A free certificate from Let's Encrypt covers encryption for most sites, and a free firewall plugin covers the basics. Paid options add features such as cloud filtering and malware removal, but the free steps in this guide already cover the main risks.

Sources

  1. Hardening WordPress WordPress Developer Resources
  2. wp-config.php WordPress Developer Resources
  3. Version 7.1.4 WordPress.org
  4. Requirements WordPress.org
  5. Let's Encrypt Resource Hub Let's Encrypt
  6. Strict-Transport-Security MDN

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

Written and checked byWPLegible Editorial Team Independent WordPress reviews and guides

Researched from the primary sources listed above and checked against our editorial rules before publishing.