There’s nothing worse than finding out your website has been compromised. The WordPress admin area is the main entry point for hackers, making it the most critical part of your site to protect.
We know it can be stressful to think about brute force attacks or data theft. Many website owners worry that they don’t have the technical skills to properly secure their dashboard.
The great news is you don’t need to be a security pro to make a huge impact. In our experience managing thousands of WordPress sites, we’ve found that a few straightforward changes are all it takes to build a strong defense.
In this guide, we’ll walk you through the most effective tips for securing your admin area. These simple steps will give you peace of mind and keep your website safe.

We will cover many tips, and you can use the quick links below to jump between them:
- 1. Use a Firewall
- 2. Password-Protect WordPress Admin Directory
- 3. Always Use Strong Passwords
- 4. Use Two-Step Verification on WordPress Login Screen
- 5. Limit Login Attempts
- 6. Limit Login Access to IP Addresses
- 7. Disable Login Hints
- 8. Require Users to Use Strong Passwords
- 9. Reset Password for All Users
- 10. Keep WordPress Updated
- 11. Create Custom Login and Registration Pages
- 12. Learn About WordPress User Roles and Permissions
- 13. Limit WordPress Dashboard Access
- 14. Log Out Idle Users
- Frequently Asked Questions About Securing the WordPress Admin
- Additional Resources for WordPress Security
1. Use a Firewall
A website application firewall (WAF) monitors your site traffic and blocks suspicious requests before they can reach your server. This is your first line of defense against hacking attempts.
While there are several WordPress firewall plugins, we recommend a DNS-level firewall like Cloudflare. DNS-level firewalls are more effective because they block threats at the network edge, so malicious traffic never even gets to your website.

At WPBeginner, we use Cloudflare’s enterprise plan to protect our website from hacking attempts, malware, and other malicious activity. For step-by-step setup instructions, see our article on how to set up the Cloudflare free CDN for your website.
Another great option is Sucuri, which we previously used. For more details, see our article on why we switched from Sucuri to Cloudflare.
2. Password-Protect WordPress Admin Directory
Another tip that we have found to be extremely effective is adding password protection to the WordPress admin directory. This adds a second layer of defense, requiring two separate passwords to access your dashboard.
You can do this from your WordPress web hosting control panel. Here are the steps for cPanel:
- Log in to your WordPress hosting cPanel dashboard and click on the ‘Directory Privacy’ icon.
- Select your
wp-adminfolder, which is typically located inside the/public_html/directory. - Check the box next to ‘Password protect this directory’ and provide a name for it.
- Click ‘Save’, then go back to create a user with a new username and password.

Now, anyone trying to access your admin login page will first see an authentication prompt.
This blocks most automated bot attacks.

For more detailed instructions, see our guide on how to password-protect the WordPress admin (wp-admin) directory. Please note that these steps are for hosts using cPanel. If you use a different control panel, check your host’s documentation.
3. Always Use Strong Passwords

You must use strong, complex passwords for all your WordPress accounts. Weak passwords are one of the most common reasons websites get hacked.
A strong password uses a combination of uppercase and lowercase letters, numbers, and special characters (!, #, @, %, etc.). The longer it is, the more secure it will be.
It’s nearly impossible to remember dozens of complex passwords. That’s why our entire team at WPBeginner uses a password manager app like 1Password to securely generate and store unique passwords for every service.
For more information on this topic, see our guide on the best way to manage passwords for WordPress beginners.
4. Use Two-Step Verification on WordPress Login Screen

Two-step verification, also known as two-factor authentication (2FA), adds another critical security layer. We use 2FA not just on our WordPress websites but on all our online accounts where the option is available.
After entering your password, you must also provide a time-sensitive code generated by an app on your phone, like 1Password or Authenticator. Even if a hacker steals your password, they won’t be able to log in without your phone.
For detailed step-by-step instructions, see our guide on how to set up 2-step verification in WordPress using Google Authenticator.
5. Limit Login Attempts

By default, WordPress lets users try to log in as many times as they want. This allows hackers to use automated scripts to try thousands of password combinations in what’s known as a “brute force attack.”
You can easily stop this by installing the Limit Login Attempts Reloaded plugin. After activation, go to Settings » Limit Login Attempts to configure how many failed attempts are allowed before an IP address is temporarily blocked.
For detailed instructions, see our guide on why you should limit login attempts in WordPress.
To learn more about the plugin, you can also check out our detailed Limit Login Attempts review.
6. Limit Login Access to IP Addresses
Warning: This is an advanced technique and should only be used if you have a static (fixed) IP address. Most home internet connections use dynamic IPs that change regularly. If you use this method with a dynamic IP, you will lock yourself out of your own website.
If you have a fixed IP, you can restrict access to your admin area to only that address. Simply add this code to your .htaccess file:
Don’t forget to replace the ‘xx’ values with your own IP address. You can easily find your current IP address by searching “what is my IP address” on Google. If you use more than one IP address, be sure to add them as well.
For detailed instructions, see our guide on how to limit access to WordPress admin using .htaccess.
7. Disable Login Hints

When a login fails, WordPress tells you whether the username or password was incorrect. While helpful for users, these hints also confirm a valid username to an attacker, making their job easier.
You can hide these hints by adding the following code to your theme’s functions.php file. However, we recommend using a code snippets plugin like WPCode. It’s a much safer way to manage custom code without risking site errors.
function no_wordpress_errors(){
return 'Something is wrong!';
}
add_filter( 'login_errors', 'no_wordpress_errors' );
For more details, see our guide on how to add custom code in WordPress without breaking your website.
8. Require Users to Use Strong Passwords
If you run a multi-author WordPress site, a single user with a weak password can create a vulnerability for everyone. You can enforce a strong password policy to prevent this.
To do this, you can install and activate the Solid Security plugin (formerly known as iThemes Security), made by the team at SolidWP.
Then, you can follow the steps in our complete guide on how to force strong passwords on users in WordPress.
9. Reset Password for All Users
For multi-user WordPress sites, you can improve security by forcing all users to reset their passwords. This is especially useful if you suspect a security breach or just want to enforce a new password policy.
First, install and activate the Emergency Password Reset plugin. Upon activation, go to the Users » Emergency Password Reset page and click the ‘Reset All Passwords’ button.

For detailed instructions, see our guide on how to reset passwords for all users in WordPress.
10. Keep WordPress Updated
WordPress frequently releases new versions to add features and fix security vulnerabilities. Running an outdated version of WordPress, your plugins, or your theme is one of the biggest security risks you can take.
Always make sure you are using the latest version of the WordPress core software, as well as all your plugins and themes. For more on this, see our guide on why you should always use the latest version of WordPress.
11. Create Custom Login and Registration Pages
For sites that require user registration, such as membership sites or online stores, you should create custom login and registration pages.
This prevents non-admin users from ever needing to see or access the default WordPress login screen. It provides a more professional user experience and allows you to completely lock down the standard wp-admin access without affecting your members or customers.
The easiest way to do this is with a plugin like WPForms, which has a powerful User Registration addon. For detailed instructions, see our guide on how to create custom login and registration pages in WordPress.
12. Learn About WordPress User Roles and Permissions
WordPress has a built-in user management system with different roles and capabilities. Assigning the wrong role can give a user far more permissions than they need, creating a potential security risk.
It is important to understand what each role can do before adding users to your site. Here are the 5 default roles:
- Administrator: Has full access to all settings and content on the site.
- Editor: Can publish and manage all posts, including those of other users.
- Author: Can publish and manage their own posts only.
- Contributor: Can write and manage their own posts, but cannot publish them.
- Subscriber: Can only log in and manage their own profile.
For a complete breakdown, see our beginner’s guide to WordPress user roles and permissions.
13. Limit WordPress Dashboard Access
On some sites, certain users may not need access to the WordPress dashboard at all. By default, any user can log in and see the admin area, even if their capabilities are limited.
To fix this, install and activate the Remove Dashboard Access plugin. After activation, go to Settings » Dashboard Access and select which user roles can access the admin area. Others can be redirected to the homepage or another URL.
For more detailed instructions, see our guide on how to limit dashboard access in WordPress.
14. Log Out Idle Users

Logged-in users who walk away from their computers can pose a security risk. If their computer is public or shared, someone else could access their account.
You can solve this by installing the Inactive Logout plugin. Go to Settings » Inactive Logout and set a time limit. After that period of inactivity, users will be logged out automatically.
For more details, see our article on how to automatically log out idle users in WordPress.
Frequently Asked Questions About Securing the WordPress Admin
What is the most important step to secure my WordPress admin area?
Using a Web Application Firewall (WAF) is the most critical first step. A good firewall, like Cloudflare or Sucuri, blocks malicious traffic before it ever reaches your site, preventing a wide range of attacks.
Is password-protecting the wp-admin directory really necessary?
While not mandatory, it is highly effective. It adds a second layer of authentication that stops almost all automated bots that try to brute-force your login page. It’s a simple change that significantly boosts security.
Can I get locked out of my own site by following these tips?
Yes, if you are not careful. The tip to limit login access to specific IP addresses is for advanced users with a static IP only. If you use a normal, dynamic IP address, you will lock yourself out. Always back up your site before editing files like .htaccess.
Additional Resources for WordPress Security
We hope this article helped you learn some new tips and hacks to protect your WordPress admin area.
You may also want to see our other expert guides for keeping your site safe:
- The Ultimate WordPress Security Guide – Step by Step
- Best WordPress Security Plugins to Protect Your Site (Compared)
- How to Scan Your WordPress Site for Potentially Malicious Code
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Danang Sukma
Thanks for your post.
Im using password protect for my wp-admin folder in cpanel, is it enough?
mby
uh what a useful info guys, it can help surely!!
thanks for posting! ^_^
anthony
This is great information which I will be implementing ASAP!I have already experienced having my blog hacked so have been worried about these issues.Many thanks!!
shoaib hussain
man m moving from one post to the other in your blog and m loving it it.thnx a lot.guess i’ll have to subscribe now.
tzutzu
AWESOME post!! Thank you for this info
Marlin
Thanks Nice list this will surely help to secure wordpress admin panel.
Abhilash Thekkel
Very useful tips. Thank you
Jessica
I’m currently learning wp development. I want to make a ecommerce site with wordpress using the WP e-Commerce plugin. Does anyone know if these tips will keep my ecommerce site secure.
Editorial Staff
Make sure that you have SSL Protection on your e-commerce site for all transactions. These are only to protect your admin area.
Admin
Ursula Comeau
Wow – this is an AWESOME post! Thank you so much for sharing all this information – and some great plugins as well!
In a world where security has become top priority, these are very important things to be aware of with a WordPress installation. Really appreciate your transparency and willingness to share this information! I’ll be tweeting this one.
Lilia
The problem with plugins is that they’re not always compatible with every version, and they aren’t always updated.
Editorial Staff
Most plugins are compatible with newer versions, and if the developer decides to leave development of the plugin, others often pick up and create a plugin with fixes for the future releases. You just have to stay active in the community.
Admin
Smashing Themes
Seriously guys, change your site name to WP ROCKER, you guys rock hard. I installed three plugins to protect my admin panel after reading this great post.
Dagmar
There are also some paid plugins – i.e. “WP Secure” which also claims it is going to make your WP secure from hackers. It also works on the summary of couple of the principles above – i.e. custom made login page, one IP confirmation etc.
Is it worthy to purchase? = anybody knows if it is easier to use for non-techie than some of the above mentioned?
Editorial Staff
If you can do the work for free then what is the point in paying?
Admin
iHacks
Link to WordPress Firewall Plugin?
Editorial Staff
It is working now.
Admin
Kjetil
Hi
Thanks a lot for your tips.
Regarding tip 8, I wonder how to insert the code
`add_filter(’login_errors’,create_function(’$a’, “return null;”));`
What is the complete function to use?
I’d like to try since I already use AskApache Password Protect and that plugin is incompatible with Secure Wordpress.
Thanks,
Kjetil
– http://www.dolcevita.no
Editorial Staff
You go to functions.php and insert that code. Thats all if we understand your question clearly. If this has not answered it, then please reply to the comment and we will surely take a look at it.
Admin
Robinoz
Thanks for this invaluable information. I’ve just suffered a malware attack that put my blog off line for a day or two while I had my Wordpress programmer sort it out. Ver inconvenient.
I’ll be implementing some of the suggestions you’ve made in the next day or so.
Robinoz
http://www.e1jobs-blog.com (All About Jobs blog”
secure server
good tips for securing wordpress. as time goes we are going to see hosts either become more stringent and secure or cms packages need to implement on install a few more security initiatives.
abbie
Hi. You’ve written a very good post.
I’ve rewrote this great post in Indonesian language.

I really hope you dont mind.
Editorial Staff
We have sent you an email regarding this. We do not allow full article translation. Please summarize it and link to our article if your users want to read the full tips.
Admin
abbie
Thanks for your response.
I’ll revise my post.
Arie
Hi there..
I want to ask something for you.
Besides i has to use askimet, captcha word, storng psswrd, is any other way for hacker to sabotage our web.
Thats my question, please repp to my mail
Regards,
Arie
Editorial Staff
Yes, if your host has vulnerabilities, then the hacker can get you down as well.
John Macpherson
It took me a few minutes to work this one out but you have the wrong kind of quotes around this function
add_filter(’login_errors’,create_function(’$a’, “return null;”));
It should be:
add_filter(‘login_errors’,create_function(‘$a’, “return null;”));
Other than that, great post.
jakesjohn
What you can from Wp-PreventCopyBlogs Wordpress Plugin
1.Track the visitors who try to copy your content.
2.Record the ip of the user who tries to do fraudulent copy with their landing url of your site and referral url.This can help you to do necessary measures if you notice something bad.
3.Enable Message displayed to your user upon user’s choice.
4.Disable Selection of you text and Right Click for users depending on the option.
Srecko Bradic
I must congratulate with this excellent article!!! To be honest I know for some tips but some very important info was unknown for me until now!
Keep on good work
Soxialize
Excellent post! Will be testing several of the security tips you provided. Thanks for putting all this together!
Heather
Brilliant post, I think I’ll sleep better tonight!
Henry
Regarding #6, if you use the following .htaccess file you will be able to login from other locations in a two-step process. This requires you to add a htpasswd file (read your server documentation).
AuthUserFile ‘some htpasswd file’
AuthGroupFile /dev/null
AuthName “WordPress Admin Access Control”
AuthType Basic
order deny,allow
deny from all
Require valid-user
# whitelist Syed’s IP address
allow from xx.xx.xx.xxx
# whitelist David’s IP address
allow from xx.xx.xx.xxx
# whitelist Amanda’s IP address
allow from xx.xx.xx.xxx
# whitelist Muhammad’s IP address
allow from xx.xx.xx.xxx
# whitelist Work IP address
allow from xx.xx.xx.xxx
Satisfy Any
The “require valid user” and “satisfy any” lines will force the Apache Server to request a Username and Password before you can access the WordPress Login screen. Please DO NOT use the same Username and Password in the htpasswd file that you use for your WordPress access, or you will defeat the purpose of the extra level of security.
Editorial Staff
Thanks for the suggestion. Post updated with a link to this way as well
Admin
Laura
Thanks for the great article. I’m looking forward to making my own blog more secure.
A.rnaud
I just made a French translation of your article on my blog (http://bit.ly/19V6YU)
thanks for the tips !
Editorial Staff
Thanks for the translation
Admin
Constantine
Hi, I have been blogging for 3 years. My blog got hacked in June 2009 and google banned for 30 days, my pageviews immediately slide from 800 a day to less than 100 a day.
I highly recommend installing wordpress firewall plugin. The plugin will send your an email every time someone tries to hack your blog together with the hackers IP address. The plugin detects and blocks strange requests, redirecting the attack to the homepage.
On monday i got an email of six attempted hack attempts over the weekend. The hacker tried the admin page three times when that failed he tried searching wordspew plugin which i dont use.
To all newbies good luck
Editorial Staff
Thanks for suggesting this one. Its now added in the post
Admin
Renee Fischer
Once a hack is successful the bot or human hacker will keep your data and keep retrying your website files looking for a way back in. they will continue to be relentless. if they have happened to hack your email or computer or server they will keep going until they have hacked everything you touch. they are like cockroaches that found crumbs that led to your house.
Dirk
In reality 2., 7. and 11. (if not hardened) are the most important things. The other things are nearly unnecessary
Typhoon
Real a very useful article. I tweeted it.
By the way I want to ask one thing; How does Stealth Login works for guest authors?
Editorial Staff
You give them the special URL that you created if you trust them enough. For the most part, guest authors should not even be allowed in the admin panel unless they are authors of your site. If someone has written multiple posts for your site then they can be trustable so you can give them the special url /login or /googlogin or whatever you created.
Most top blogs take guest posts via email and if those guest authors become regular authors, only then they are allowed in the admin panel.
Admin
Misao
Thank you! Very helpful article. I will try your tips and hacks on some of my blogs.
sriganesh
very useful.
:geek: thanks for sharing. i will spred this surely
Yves
Hi
Nice list! You may want to add the nice “One time Password” plugin for Wordpress:
http://wordpress.org/extend/plugins/one-time-password/
quicoto
Thanks for the tips
Tim
Great tips.
For the involved readers there is an inaccuracy in #6.
“The downside to this hack is that if you ever want to access the admin panel from some other place, you won’t be able to do so unless you add that extra IP in your .htaccess file.”
If the ip-address you allow is a box you can can SSH into, you can SSH tunnel through it (I use foxyproxy, because it makes the switch very easy). Also, if you are using nginx instead of apache you can evaluate the URI w/ regular expressions to block everything from wp-app.php to wp-trackback.php (or selectively choose which ones you do not want to block). I cover this @ http://www.phrison.com/securing-arbitrary-uris/ but it is not for the unexperienced.
I have a large collection of tin-foil hats.
Editorial Staff
You are correct.
Warning: New users don’t try this at all. This is for experienced users only.
Admin
SaigonNezumi(Kevin)
Thanks for this piece. I have been waiting for an article like this. Adding a couple of your tips will help secure my WP sites.
Thanks again.
Editorial Staff
You are welcome
Let us know which one you use and your thoughts on the process of implementing it.
Admin
Dana DeFazio
I’m wondering if there is something comparable for my blog because it is a WordPress.com site and also I have a new blog at danaddiamond.BlogSpot.com
Editorial Staff
WordPress.com does not allow you to have a lot of privileges but with their server, you are safe for the most part.
Admin
Tinh
Excellent tips and hacks, I only applied 6 of 11 tips you suggested, let me try the rest
Jo
This site is a happy new find for me (FYI,thanks to @Problogger on Twitter), and I’m looking forward to further exploration. This article is the kind of tight, clear writing that is too rare these days. Thanks for some genuinely helpful information.
Editorial Staff
We are glad that you like our site, and we are also very glad that Darren found the article useful enough to tweet it. We hope you follow us on twitter so you can stay up to date with all the nice tutorials.
Admin
Marc
Wow – I’m fairly new to WP and had no idea there were so many gateways for hackers. I’m sure they won’t find their way in after adding a few of these.
Thanks.
Roger Duck
WordPress security is a growing issue and these steps are critical for securing a WordPress site. Beefing up security helps the entire community as well as your own site to take time to implement these ideas. Well done.
Rob
And to protect all your hard work / security features from your clients….
http://wordpress.org/extend/plugins/hide-admin-panels/
James Morrison
A good list of vital tips to secure your site. I particularly like #8 I’ve never done this before but will from now on!
Regarding #7 – Remove ‘admin’ username:
I don’t remove the admin username, I create a new admin account then change the ‘admin’ users account type to subscriber.
That way, even if someone does crack the password it’s a useless account. If you remove it, someone can register that username…
Kathlene
Qwerstion for James Morrison. Can you explain a bit more what you are saying and how to do it?
For the staff, I have tried a number of times to get a number for the akisnet plugin and cannot seem to come by one. How is one obtained.
Very nice post. I will be implementing these directly. I had one of my blogs hacked twice in 30 days once.
Thanks for the great info.
James Morrison
Follow these steps:
1.) Create a new user account with admin access (eg ‘James’)
2.) Sign in with new account to WP Admin
3.) Edit ‘admin’ users’ account and change access to subscriber
That way if someone tries to compromise the admin account and succeeds they still can’t do anything bad to your site.
To get an akismet key you need to sign up for one at http://www.wordpress.com
Hope this helps!
Mathdelane
You can always change the default “admin” username to anything you wish via phpMyadmin database. Here’s my post about it as well as my experience about blog hacking and security:
http://softwarecritics.info/open-source/blogosphere-alert-prevent-your-wordpress-blogs-from-being-hacked/
Cheap Sites
Thank you for all the suggestions, I’m working on a few big projects and this will certainly help once the blogs are up and running.
First time here and I’m loving the blog, good job!
Dan
Editorial Staff
Glad that you like it here. Feel free to make any suggestions if you ever have a question, or would like some specific topic covered at WPBeginner.
Admin
Flow Interactive
Good tips. You can also move your wp_config.php file outside of the web root to provide an extra layer of security.
Editorial Staff
Yes you can do that, but in this article we were only talking about WordPress Admin Panel not the entire site in general. There are many other ways to protect your site entire WordPress blog.
Admin
Shabayek
But what if you allow your blog visitors to register, and force them to log on before posting comments?
Editorial Staff
Then you cannot use the IP protect and others, but you should still use limit lockdown, not use admin username, and semisecure login.
Admin
Gerald Weber
I use the limit loggin requests to my ip address. This mean that anyone that attempts to access http://www.domainname.com/wp-admin that is not making the request from my ip address will simply get a 404 page.
Blogspot to wordpress
Hey very useful post.
MOst INteresting IDeas blog
Useful post for my blog.
Dreyer
A helpful list. Will be giving these a go. Better paranoid than sorry.
Rafi
Hey this is a wonderful collection of tips and hacks, very useful. I recommend every WP blogger to go through the list and follow the steps as well as any other useful resources available elsewhere. After all we have NOT set up our blogs so someone shall take control of our lives. Damn.
Thanks for sharing, WPBeginner.
Sergej Müller
Link to WordPress AntiVirus Protection?
Editorial Staff
No matter how much you proofread, some thing are always missed. Glad we have users like you. Link added. Thanks again.
Admin
Lolic
What about aksimet and captcha systems?