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

Explainers · Explainer

What Is WordPress Hardening? Explained

What Is WordPress Hardening? Explained

Short answer

WordPress hardening means making your site harder to attack by closing weak points. It covers strong logins and two-factor authentication, safe file permissions, turning off the file editor, HTTPS, updates and removing unused plugins, themes and users.

Key takeaways

  • Hardening shrinks the number of ways attackers can get in.
  • It works alongside security plugins, monitoring and backups.
  • Two-factor authentication and updates give the biggest gains.
  • Disabling the built-in file editor is a quick, useful change.
  • Some tips, like changing the table prefix, add little real security.

What is WordPress hardening?

WordPress hardening is the practice of making a WordPress site harder to attack by removing weak points, tightening settings and limiting what each user, file and service is allowed to do.

The word comes from general computer security. To harden a system means to shrink its attack surface, so there are fewer doors for an attacker to try.

WordPress core is maintained by a dedicated security team, and the WordPress security page explains how core issues are handled. Most hacked sites are broken into through outdated plugins, weak passwords or poor hosting setups, not core flaws.

Hardening closes those gaps. It is not one plugin or one setting. It is a checklist of small changes that add up.

How is hardening different from a security plugin?

Hardening changes how your site and server are set up so attacks fail, while a security plugin mostly watches for threats, scans files and blocks bad traffic.

Think of it like a house. Hardening is fitting better locks and closing windows you never use. A security plugin is the alarm and the camera.

ApproachWhat it doesExamples
HardeningRemoves weak points and limits accessDisabling file editing, strong passwords, correct permissions
Security pluginDetects and blocks threatsMalware scans, firewall rules, login limits
MonitoringTells you when something changesUptime checks, file change alerts, activity logs
BackupsLets you recover after a problemDaily off-site copies

Many security plugins include hardening options, so the line is blurry. Our guide on what a security plugin is explains what they cover. You still need both ideas for a well-protected site.

Which areas does WordPress hardening cover?

Hardening covers your hosting server, WordPress settings, user accounts, files and folders, login page, plugins and themes, and the connection between visitors and your site.

The official Hardening WordPress guide groups advice into similar layers. The sections below explain each one in plain terms.

You do not need every item on day one. Start with the changes that block the most common attacks, then work through the rest.

How does hardening protect user accounts and logins?

Account hardening means strong unique passwords, two-factor authentication, fewer admin users, and limits on repeated login attempts.

Stolen or guessed passwords are one of the most common ways into a WordPress site. Bots try thousands of username and password pairs every day.

Key steps include:

  • Use strong, unique passwords for every account, stored in a password manager.
  • Turn on two-factor authentication for all admins and editors. Our guide on adding two-factor authentication shows how.
  • Avoid the username admin. It is the first one bots try.
  • Give people the lowest role they need. A writer does not need administrator access.
  • Remove old accounts when staff or contractors leave.
  • Limit login attempts with your host's firewall or a plugin.

Changing the login URL can cut bot noise, but it is not real protection on its own. Our article on whether to change the WordPress login URL weighs the pros and cons.

How does hardening protect WordPress files?

File hardening means setting correct permissions, turning off the built-in file editor, protecting wp-config.php, and stopping PHP from running in the uploads folder.

If an attacker gets into the dashboard, the theme and plugin editor lets them add code in seconds. Turning it off is a one-line change in wp-config.php:

define( 'DISALLOW_FILE_EDIT', true );

Other file hardening steps:

  • Set safe permissions. Folders are usually 755 and files 644, with wp-config.php tighter. Our guide on setting correct file permissions lists the details.
  • Block PHP in uploads. The uploads folder only needs images and documents, not scripts.
  • Keep secret keys fresh. The salts in wp-config.php should be unique and can be regenerated if you suspect a breach.
  • Remove unused themes and plugins. Even inactive code can be attacked if it sits on the server.

How does hardening protect the server and connection?

Server hardening includes running a supported PHP version, using HTTPS everywhere, adding security headers, and choosing a host that isolates accounts and patches its software.

You control some of this, and your host controls the rest. Good hosting matters a lot here.

Points to check:

  • HTTPS on every page, with a valid certificate
  • A current, supported PHP version, since old versions stop getting security fixes
  • Security headers, such as Strict-Transport-Security, which tells browsers to always use HTTPS
  • Account isolation on shared hosting, so one hacked site cannot reach another
  • A web application firewall, either from your host or a service such as a CDN

The WordPress hosting team's security handbook explains what good hosts should do. Our guide on adding security headers to WordPress covers the header side.

On cheaper shared plans, you have fewer server controls. Our guide to hardening WordPress on shared hosting focuses on what you can still change.

Does turning off XML-RPC count as hardening?

Yes, turning off XML-RPC is a common hardening step if you do not use it, because bots abuse it for password guessing and it is rarely needed on modern sites.

XML-RPC is an older way for apps to talk to WordPress. The REST API now does most of that work. Some tools, such as certain mobile apps and Jetpack features, may still rely on XML-RPC, so check before you block it.

Our guide on disabling XML-RPC in WordPress shows the safe ways to do it.

Is keeping WordPress updated part of hardening?

Yes, keeping core, plugins, themes and PHP updated is the single most important hardening habit, because most attacks target known flaws that already have fixes.

When a plugin vulnerability goes public, bots start scanning for unpatched sites within days. An update closes the hole.

Good update habits:

  • Turn on automatic updates for minor core releases, which WordPress does by default.
  • Turn on auto-updates for trusted plugins, or check for updates every week.
  • Replace plugins that have not been updated in a long time.
  • Test big updates on a staging site first.

Hardening without updates is like fitting a new lock and leaving the key in the door.

Which hardening tips are myths?

Some popular tips add little real security, such as changing the database prefix on an existing site or hiding the WordPress version, though they do no harm when done carefully.

TipReal benefit
Changing the wp_ table prefixSmall; can break a live site if done wrong
Hiding the WordPress versionSmall; scanners detect WordPress anyway
Changing the login URLCuts bot noise; not a defence on its own
Two-factor authenticationLarge
Updating plugins promptlyLarge
Removing unused pluginsLarge
Disabling the file editorMedium to large

Spend your time on the items with large benefits first. Then add the smaller ones if you like.

How do you start hardening your WordPress site?

Start by taking a backup, updating everything, removing unused plugins and users, and turning on two-factor authentication, then work through file and server settings.

A simple first pass:

  1. Take a full backup and store it off the server.
  2. Update WordPress, plugins, themes and PHP.
  3. Delete plugins, themes and users you do not need.
  4. Turn on two-factor authentication for admins.
  5. Add DISALLOW_FILE_EDIT to wp-config.php.
  6. Check file permissions.
  7. Make sure the whole site runs on HTTPS.

After that, run a full WordPress security audit every few months to catch anything that has slipped. Security is never finished, but a hardened site is a far less tempting target.

Frequently asked questions

Do I need a plugin to harden WordPress?

No. Many hardening steps are settings in wp-config.php, your hosting panel or user profiles. Security plugins make some steps easier, such as login limits and two-factor authentication, but a plugin alone does not harden a site that has weak passwords or outdated code.

Can hardening break my site?

Some steps can, such as tightening file permissions too far, blocking XML-RPC when an app needs it, or changing the database prefix on a live site. Take a backup first, change one thing at a time and test the site after each change.

How often should I review WordPress hardening?

Check updates weekly and review users, plugins and settings every few months. Run a fuller review after major changes, such as a new host, a redesign or adding staff accounts, since those often reopen gaps you closed before.

Is WordPress secure without hardening?

WordPress core is well maintained, but a default install still depends on your passwords, plugins and hosting. Most hacks exploit those weak points. Hardening reduces the risk a lot, though no site can ever be made completely immune to attack.

Does hardening slow down WordPress?

Most hardening steps have no effect on speed. Some security plugins that scan every request can add load, and a web application firewall at the host or CDN level is usually lighter. Removing unused plugins often makes a site faster, not slower.

Sources

  1. Hardening WordPress WordPress Developer Resources
  2. Security WordPress.org
  3. Security WordPress Hosting Handbook
  4. Strict-Transport-Security MDN Web Docs

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.