How to Secure WordPress: 15 Settings to Check

By Bug Circuit Security Team
How to Secure WordPress: 15 Settings to Check

Is your own website affected? Check it free in 2 minutes.

Passive outside check only. Nothing is attacked, no signup.

To secure WordPress, keep everything updated, protect your admin logins with strong passwords and two-factor authentication, and switch off the features attackers like to abuse: the built-in file editor, XML-RPC, and PHP running inside your uploads folder.

This post is for owners of small WordPress sites who want a concrete list of settings, not a plugin pitch. You will get 15 checks in priority order. Each one says where to look and what "good" looks like. Most take under five minutes, and none promise perfect security (nothing can). They remove the easy ways in.

The 15 checks at a glance

Start at the top. The first group blocks the most common routes into a WordPress site.

PriorityChecksRough time
Do today1 to 6: updates, unused plugins, passwords, two-factor, admin accounts, login limits30 minutes
Do this week7 to 11: file editor, XML-RPC, file permissions, wp-config, HTTPS30 to 45 minutes
Do this month12 to 15: uploads folder, debug and listings, headers, backups30 minutes

The official WordPress hardening guide covers many of these in more depth. Before you edit any files, take a quick backup (see check 15 for how to do it properly).

Do today: stop the easy wins

1. Update WordPress core

Core means WordPress itself. Go to Dashboard > Updates. Small security releases usually install on their own, but check that yours did. If you have command-line access, wp core check-update shows what is pending.

2. Update plugins and themes, and delete what you do not use

Outdated plugins are a common way WordPress sites get broken into. Go to Plugins > Installed Plugins and turn on Enable auto-updates for the ones you trust. Then delete any plugin or theme you do not use. Deactivated is not the same as safe: the files still sit on your server. wp plugin list --update=available lists the plugins that need updating.

3. Use long, unique passwords

A password manager makes this easy. Give every admin, editor and hosting account its own password. The OWASP Authentication Cheat Sheet recommends length over clever symbols, so a long passphrase beats P@ssw0rd!.

4. Turn on two-factor authentication (2FA)

2FA asks for a second proof, usually a code from your phone, after the password. It means a stolen password alone is not enough. CISA's multifactor guidance explains why it matters. Free options include the Two Factor plugin and WP 2FA. Require it for every Administrator and Editor.

5. Review admin accounts

Open Users > All Users and filter by Administrator. Each person should have the lowest role that lets them do their job. A blogger needs Author, not Administrator. Delete accounts for people who have left. If someone still logs in as admin, create a new administrator with a different username, then delete the old one and assign its content to the new account. Via command line: wp user list --role=administrator.

6. Limit login attempts

Bots guess passwords all day. Rate limiting locks out an address after a few failed tries. Plugins such as Limit Login Attempts Reloaded do this, and many hosts offer it at the server level. To test it, fail a login about ten times with a made-up username from a private window and see if you get blocked. Check that you can unlock your own address afterwards (usually by waiting or through your host).

Before you test, take three precautions. Use a made-up username or a spare account, never your real admin account. Keep a second admin session open in another browser, so you can still get in. And know how to unblock yourself: wait for the lockout to expire, ask your host, or add your address to the plugin's allowlist.

Do this week: close the risky features

7. Disable the built-in file editor

WordPress lets admins edit plugin and theme code from the dashboard. If an attacker gets into one admin account, that editor lets them plant code in seconds. Check by opening Appearance > Theme File Editor (on block themes it is under Tools > Theme File Editor). If it loads, it is on. Also look at Plugins > Plugin File Editor. A missing menu on a block theme does not prove the setting is on, so confirm by looking for the line below in wp-config.php. Add it above the line that says "That's all, stop editing":

define('DISALLOW_FILE_EDIT', true);

The editor menus will disappear. You can still update plugins as normal.

8. Block XML-RPC if you do not need it

XML-RPC is an old remote-control feature at /xmlrpc.php. Attackers use it to try many passwords in one request. To check, visit https://yoursite.com/xmlrpc.php. If you see "XML-RPC server accepts POST requests only," it is on.

Most small sites do not need it. Some tools, such as Jetpack, may. If you are not sure, block it, then test your integrations. On Apache 2.4, add this to the .htaccess file in your site root:

<Files xmlrpc.php>
Require all denied
</Files>

Nginx does not read .htaccess. Use location = /xmlrpc.php { deny all; } in your server config, or ask your host.

9. Set safe file permissions

Permissions decide who can read or change files on the server. Common safe values are 755 for folders and 644 for files. The wp-config.php file, which holds your database password, should be tighter: 640 or 600, depending on your host. From the site root over SSH:

find . -type d -exec chmod 755 {} +
find . -type f -exec chmod 644 {} +
chmod 640 wp-config.php

Afterwards, confirm the site still loads and that you can still upload an image to the media library. Note that 640 on wp-config.php can break sites where PHP runs under a different user or group than the file's owner. If you see a blank page or a database error, ask your host which value fits.

Never use 777 (anyone can write). If something breaks after changing permissions, ask your host rather than loosening everything.

10. Harden wp-config.php

Three things to check in this file:

  • Keys and salts. These eight random strings protect login cookies. If they still say put your unique phrase here, generate fresh ones at https://api.wordpress.org/secret-key/1.1/salt/ and paste them in. Everyone gets logged out, which is a useful side effect after any scare.
  • Database credentials. Use a strong, unique database password, and never reuse it elsewhere.
  • Location. WordPress also finds wp-config.php one folder above the web root, where browsers cannot reach it. Ask your host if that is possible.

11. Force HTTPS for logins

HTTPS encrypts traffic between a visitor and your site. In Settings > General, make sure both addresses start with https://. Only change them once https://yoursite.com already loads in your browser without a warning. If the certificate is not working yet, switching the addresses can lock you out of the dashboard. Then add this to wp-config.php:

define('FORCE_SSL_ADMIN', true);

This setting only forces HTTPS for the login and admin screens. It does not redirect the front end of your site. The site-wide redirect comes from your host or SSL setting, or from the https:// addresses in Settings > General. To test, visit http://yoursite.com and confirm it ends up on https://. If it does not, check the HTTPS or SSL option in your hosting dashboard.

Do this month: reduce what attackers can reach

12. Stop PHP from running in the uploads folder

The wp-content/uploads folder should hold images and documents, not programs. If an attacker slips a script in, this rule stops it from running. This is a standard defence for upload folders, discussed in the OWASP File Upload Cheat Sheet. On Apache 2.4, create wp-content/uploads/.htaccess containing:

<FilesMatch "(?i)\.(php|phtml|phar|php[0-9])$">
Require all denied
</FilesMatch>

The pattern ignores upper and lower case and covers other extensions that PHP handlers often run, such as .phtml, .phar and .php5.

On Nginx, ask your host to add location ~* ^/wp-content/uploads/.*\.(php|phtml|phar|php[0-9])$ { deny all; }. Nginx uses the first regex location that matches, so a regex location can lose to an earlier location ~ \.php$ block. The host should place this rule above that block, then confirm it works by requesting a test file in uploads.

13. Turn off debug output and directory listings

Debug messages can reveal file paths and database details. In wp-config.php, production sites should have:

define('WP_DEBUG', false);

Then visit https://yoursite.com/wp-content/uploads/. If you see a list of files, add Options -Indexes to your root .htaccess. Also try https://yoursite.com/wp-content/debug.log. It should show a "not found" or "forbidden" error, not a log.

14. Add basic security headers

Headers are short instructions your server sends to browsers. Three low-risk ones are X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN and Referrer-Policy: strict-origin-when-cross-origin. Run your domain through the security headers tool to see what is missing. Add them one at a time and check the site still works.

15. Keep tested, off-site backups

Backups do not stop an attack, but they turn a disaster into an annoying afternoon. Store copies away from your web server, such as in cloud storage, and do a test restore at least once. A backup you have never restored is a guess.

What these settings do not cover

This checklist cuts down the common routes in. It will not find a flaw in a custom plugin, a weak spot in your checkout, or a mistake in how your site handles user data. Automated tools catch known patterns, while a person catches logic problems. We explain the difference in manual vs automated penetration testing.

Want a quick outside view first? Run the free website security check. It looks at your domain from the outside. If something already looks wrong on your site, see what to do if your website is hacked.

Key takeaways

  • Update core, plugins and themes, and delete anything you do not use.
  • Use unique passwords plus two-factor authentication, and keep the number of administrators small.
  • Disable the file editor, block XML-RPC if you do not need it, and stop PHP running in uploads.
  • Lock down wp-config.php with tight permissions, fresh salts, and debug turned off.
  • Keep backups off-site and test a restore. Then recheck this list every few months.

Want a human to check the rest?

Settings only go so far. A Bug Circuit audit has a real security engineer test your site by hand and send a written report: every issue, how serious it is, the evidence, and the steps to fix it. Fixing is a separate service, quoted per issue, and only if you want it. The Essential plan is $49 one-time, and you can see the details on the pricing page. If you are unsure whether your site is exposed, is my website hackable? is a good place to start.

Want certainty, not guesswork?

A real human security engineer audits your whole site by hand and sends a full report: every issue, its severity, and the exact fix. From $49, with a 14-day money-back guarantee.

See pricing

Frequently asked questions

How do I stop hackers from getting into my WordPress site?
You cannot make a site unhackable, but you can block the most common routes. Keep core, plugins and themes updated, use unique passwords with two-factor authentication, and delete unused plugins. Then disable the file editor and XML-RPC if you do not need them, and keep tested backups.
What are the best WordPress security settings?
The highest-impact ones are automatic updates, two-factor authentication for admins, limited login attempts, and DISALLOW_FILE_EDIT in wp-config.php. Next come safe file permissions (755 for folders, 644 for files, tighter for wp-config.php) and blocking PHP in the uploads folder. This post lists all 15 in priority order.
Should I disable XML-RPC in WordPress?
Most small sites can, because modern WordPress does not need XML-RPC for normal use. It can be abused to try many passwords in one request. Some tools such as Jetpack may rely on it, so block it and then test your integrations.
Do I need a security plugin to secure WordPress?
Not for most of this checklist. Updates, strong passwords, file permissions and wp-config.php changes are settings, not plugins. A plugin can help with two-factor authentication and login limits, but choose one or two well-maintained ones rather than many.
What file permissions should WordPress use?
Folders are usually 755 and files 644. Your wp-config.php should be tighter, commonly 640 or 600 depending on your host. Never use 777, which lets anyone write to the file.

Keep reading

See what attackers see, for free

Run the free passive check on your website. No login, no impact on your site, results in seconds.

Ready for the full manual audit? See pricing

Published by Bug Circuit. Written with AI assistance and reviewed for accuracy before publishing.