WordPress Security Tips (Comprehensive List)

There are some simple, some free, some more difficult and some commercial solutions out there for making WordPress more secure. The question is not IF you will get hacked, but WHEN. The more you can do to secure your web site, the better.

Update 11 May 2017: After miserable experiences with SiteLock’s sales staff,
I can no longer recommend them. I recommend a secure host, iThemes Security Pro and CloudFlare as an alternative if you’re looking for malware scanning and a web application firewall (WAF).

The Basics

Below are minimal steps that you should take to help secure WordPress, in order of importance:

  1. Keep WordPress, plugins and themes updated – There are a number of ways that you can do this:
    • If you are working with a web site that isn’t too complex and/or doesn’t need to be babysat, WP Update Settings is a great plugin. It allows you to configure what to update: WordPress minor updates, major update, plugins and/or themes. It also has the option to notify you of updates. Configure as needed.
    • You can update your plugins manually if you prefer. It may help to use a monitoring services such as the free tiers of services such as ManageWP or InfiniteWP (I personally like the interface of InfiniteWP).
    • You can also modify your wp-config.php to enable automatic WordPress core major and/or minor updates.
  2. Secure your /wp-admin and wp-login.php files – This is the single most common point of attack. Renaming these entry points can dramatically reduce your risk of brute force attack:
    • Use a specific plugin: Rename wp-login.php
    • Use iThemes Security (see below for additional information)
    • (honorable mention) The Loginizer plugin helps you fight against brute force attacks, but should not be used in conjunction with iThemes Security.
  3. Don’t use easy admin usernames. Bots doing brute force attacks will often try common/obvious usernames first. Some examples of often-exploited username: admin, administrator, yourdomain.com, yourdomain, superadmin, webmaster, developer
  4. Don’t use weak passwords / enforce strong passwords – Don’t use easy-to-guess passwords like ‘123456’ or ‘buffalo’. These are easy to recover using standard dictionary attacks. Some options:
    • If you are creating your own logins, you can use the password generator or if you want something easier to remember, the usual rules apply. For example, this of a phrase like “My cat likes to catch little mice.” Your password could me something like: Mc@tL2CLm1ce. Be creative.
    • If your system allows user registration, you could consider a plugin such as Force Strong Passwords or iThemes Security.
  5. Make sure your web site is hosted on a reputable host – According to this WP Security White paper, 41% of web sites were hacked through a security vulnerability on their hosting platform. Some examples of known, reputable hosts are: WP Engine, InMotionHostGator, SiteGround and GoDaddy.
Note: Many of the security measures mentioned above can be accomplish within an easy interface using the excellent iThemes Security plugin.

WP Engine Managed WordPress Hosting

Extra Security

  1. Change your security salts – WordPress security keys help improve security by encrypting information stored in cookies. Located in wp-config.php, some providers change them by default. If they are the default (they will say, “”), you will want to change them:
    • You can create your own using the WP salt generator and then change them manually.
    • If you’re not comfortable editing files, you can use a plugin like iThemes Security to change them for you.
  2. Two-step authentication – You can use a plugin such as the Google Authenticator, which will require you to enter a code that changes periodically. You will have to install an app on your smartphone to get the code each time you login. There are other two-step authentication plugins available. I find this to be somewhat of a nuisance if you login frequently, but it does provide an excellent level of security.
  3. Delete plugins and themes that you’re not using – Although the plugins may be disabled, they still present a potential threat if there is an unpatched bug in the code. If you do not plan on using them, it is good practice to delete them.
  4. Only download plugins and themes from reputable sources – Downloading from untrusted sources presents the possibility that the plugin has not been updated for awhile (and thus may contain security holes) or may even contain malicious code injected into them for an attacker to wreak havoc. Some commonly-trusted sources include ThemeForest/CodeCanyon and the WordPress Plugin Repository.
  5. Require HTTPS for Admin and Logins – If your site has HTTPS support (check out my HTTPS guide if you don’t), you can require that WordPress logins be done via HTTPS:
  6. Disable the Plugin and Theme Editor – To disallow users who successfully login from editing sensitive files, it is a good idea to disable these features if you don’t have a need for them.
  7. Consider changing your table prefixes – The default WordPress table prefix is wp_. In the event that someone is successfully able to insert SQL injection attacks into your site, they will already know the default WordPress table names to wreak havoc.
    UPDATE (12/28/2016): WordPress Table Prefix: Changing It Does Nothing to Improve Security

    • You can use a plugin such as iThemes Security to do it for you (it is wise to do a backup first).
    • If you are savvy, you can rename the tables in the database following this guide.
  8. Protect /wp-includes/ – Files in this folder do not need to be accessed directly by the browser. As such, an extra security precaution (to protect against a newly-discovered exploit) is to remove public access to this folder. See this guide for instructions (it will require you to have access to and edit the .htaccess file in the root of your web site).
  9. Consider disabling XML-RPC – XML-RPC is user for pingbacks, trackbacks and to allow apps (such as mobile or other blogging clients) to remotely access your site. It is sometimes used for attacks. If you do not have a need for this, you can disable it. You can always re-enable it if something breaks.
    • You can use a plugin such as Disable XML-RPC.
    • A less resource-intensive method is to manually disable it in your .htaccess using this guide.
  10. Hide the WordPress version number
    • You can use a plugin such as Remove Version.
    • You can remove it manually by using this guide to add some code to your theme’s functions.php.

Other Considerations

  1. Backup your site – There are many plugins and services to backup your site locally or remotely (preferred).
    • CodeGuard – This is a very robust and automatic backup solution that is easy to use. It requires a monthly subscription.
    • Duplicator – This is one of the more popular free plugins and allows you to store a copy of your site locally. There is also Duplicator Pro, which support remote storage as an option.
    • iThemes BackupBuddy – This is one of the more popular commercial plugins, though it doesn’t have the easiest to use interface. It includes 1GB of online storage space, or you can use your own. If you prefer a one-time fee, they also offer BackupBuddy Gold if you contact sales. I like BackupBuddy Gold because there is no recurring fee, which can add up if you have multiple sites.
  2. Scan your web site – There are plugins and services that will scan your web site for malicious code. Some are limited to external scans (scanning only what the browser sees) like Sucuri. More robust solutions such as iThemes Security Pro and SiteLock will scan the contents of the files on your site as well. My personal preference is iThemes Security Pro because of relative value (it’s an annual fee unless you go Gold, however, it ends up being cheaper per month than SiteLock).
WP Engine Managed WordPress Hosting

Security Plugins

  1. iThemes Security – An all-in-one security plugin that covers most of your security needs. This is my favorite security plugin that I’ve used. There is a iThemes Security Pro available, but it requires an annual subscription. If you prefer to pay a one-time fee, they also have iThemes Security Pro Gold. iThemes Security Pro adds the following features:
    • Scheduled Malware Scanning
    • Built-in Two-Factor Authentication
    • reCAPTCHA Protection, User Logging, Password Expiration and more
  2. WordFence Security – This is an excellent security solution as well that I used for years. A pro version is also available. One thing that stands out about WordFence is its reporting – you can see where most of your attacks are coming from (for example, the majority of my attack attempts come from Ukraine). Knowing this information, you could use a plugin like IP Geo Block.
  3. Block Back Queries (BBQ) – I like this plugin because it silently sits in the background and adds additional additional security by blocking malicious malformed requests. I have successfully used it in conjunction with both iThemes Security and WordFence. A feature-limited free version is available.

Leave a Reply

Your email address will not be published. * Denotes required field.
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

Tip: Do you want an image (avatar) next to your posts? Sign up for a free Gravatar account. It only takes 5 minutes - simply click the "Create Your Own Gravatar" button, provide your e-mail address and upload a photo to associate with it.