Securing a WordPress website is essential to protect against vulnerabilities and potential attacks. Here are some comprehensive strategies gathered from various discussions.
Basic Security Measures
Advanced Security Techniques
/wp-admin
to something unique to reduce brute force attempts Security Plugins
Server and Hosting Considerations
Backup Strategies
Additional Recommendations
By implementing these strategies, you can significantly enhance the security of your WordPress website and protect it from common vulnerabilities and attacks.
Do you know any other tricks to make wordpress secure? Feel free to share in comments.
Don't confuse actual security with security through obscurity.
Point 8 and 12 doesn't provide any real security measures, or in any other way actively guards against incoming attacks.
Also I recommend using geoblocking for wp-admin, to only allow log in from trusted countries.
And point 13 also useless
WordFence!
If you know what you're doing, this isn't needed, sufficient security measures can be achieved otherwise.
Which in my opinion is preffered, because WordFence is a really heavy plugin, and sometimes slows your wordpress site to a crawl.
Might want to add that this is in no particular order. Changing the address of login would be higher up of course.
>Use SSL for data security
I assume you mean "TLS", because "SSL" is something from the 90's and is extremely unsafe.
The above is fine for a personal blog but if your business actually depends on your wordpress site and being hacked would cost you real money, you need more.
What are the ways to secure your wordpress server from hackers, aside from SSH?
What measures do you take?
Anything appreciated, and thanks in advance!
https://wordpress.org/support/article/hardening-wordpress/
A pretty good start to securing your server.
There are several ways:
Optionally you can change the admin login url address
Hei guys,
Whats the best practices to secure a website, i want to make sure my company website is very secure and not be hackable,
I have heard that WordPress could be hacked if the plugins are not up to date etc even if we install a security plugin,
Please suggest best practices to secure the website,
Thanks
All boils down to these:
This guy WordPresses.
Personally I'd skip WordFence because of the bloat. But if I need a security plugin I'd use AIOS.
I skip any security plugin - other than "Two Factor". When a plugin tries to stop attacks, that's already too late. Cloudflare or similar in front of the site can help.
or opt for solid pro sadly they don't have free version to test out. But they do have some nice login features besides 2FA and they also have patchstack included to patch any plugin issues.
Wordfence and bloat ?
wish there would be just a simple plugin that does the low resource scanning of the site.... don't need anything else from wordfence!
They are many. Search for ‘WordPress integrity check’. Wordfence is only worth if you are going to use most of the features.
Security is a major aspect of the website, and I faced some hacking issues in my earlier days. Then, I found this step-by-step guide and followed it. It helped me secure my website. You can also refer to this.
I use Virusdie and MalCare to keep my websites secure. I also use the WP Activity Log plugin to track activities on my WordPress sites as it logs actions like creating user accounts, changing permissions, and login attempts, plus it sends real-time alerts for any changes on our sites.
I do regular updates of all the apps on the sites: plugins, themes, WP core, PHP version if needed.... with 2FA on some sites.
I also make sure to back everything up regularly, so I set up regular offsite backups to my pCloud with the All-in-One WP Migration plugin and rely on daily backups from SiteGround hosting. For some sites, I also use SaaS BlogVault.
These are the basic way to prevent malware attack and cracking of your website.
Great question. Securing a WordPress site is critical, especially with so many bots and brute force attempts out there these days.
A few best practices I always recommend:
As for plugins, while Wordfence is popular, some find it heavy on resources. I personally use WP Security Ninja. It’s lightweight, runs 50+ security tests, and offers login protection, file change monitoring, and malware scans without slowing down the site. Super useful for both beginners and pros.
Security is a layered approach. Plugins help, but good hosting, smart config, and regular audits are just as important.
What setups are others here using? Always good to compare notes.
The /r/WordPress subreddit is not a place to advertise or try to sell products or services.
I woke up today with about 100 SQL injection attempts on my website.
Nothing compromised. But still, it made me think of all the measures to make the site more robust and secure.
Yeah, I know, I should've set up some rate limiting. But other than that, what measures do you take for that without affecting the normal user experience?
Here's what I already do:
I use Cloudflare with default options enabled and custom WAF rules.
WP-admin page is on a custom URL.
Sanitize all the data received from the form submissions.
What else?
EDIT:
From the suggestions, I've set up:
- Wordfence
- Cloudflare
- 2FA
- Strong Password
- Captcha
Cloudflare + Wordfence.
Pretty sure CF blocks SQLi attacks by default?
edit: 2FA and changing the admin URL doesn't protect you from vulnerabilities, which is how most WP sites are hacked.
I would be interested on why you think 2FA won't protect?
It doesn’t stop you from getting hacked - almost all hacks in WP are a result of a plugin vulnerability, which bypass the login system.
There should not be any reason for someone to have your password. If that is the case, you have much bigger problems to deal with.
Wordfence, 2FA, strong passwords.
Done! All three
Ninjafirewall, WP Armour (to protect all your forms combined with Akismet if possible), Server side Modsecurity Firewall with OWASP ruleset (which will solve 90% of your issues) combined with CSF firewall (which works server side) blocking the IPs).
But here is the thing. All this depends on who your host is. I have had dumb hosts who had most of these things and still got me hacked. Better if you can get a vps or atleast invest on some good backup options like duplicator pro and configure them to atleast 2 endpoints.
Backup is not a security option but is a fallback when you lost your corefiles.
You’ve already taken some great steps to protect your site, and that’s really good to see. One more thing you might find helpful is using a plugin like WPCode. It lets you add useful security changes, like turning off XML-RPC or limiting login attempts without needing to touch any code. It’s easy to use and perfect for beginners who want a little more control.
Also, make sure you’re doing regular backups. A plugin like Duplicator can create a full copy of your site that you can restore anytime if something goes wrong. I personally use it as a backup plan, just to be safe.
Just to add to this, Admin & Site Enhancements does a similar set of operations. Possible the plugin is smaller in scope. Worth considering as an alternative imo or worth comparing if it is more security feature rich (I've not checked).
It also does a few other things, including establishing a custom URL for admin. If OP or someone else has used this for that purpose, use ASE for the security stuff too.
As Bluesix said above, changing admin url does nothing. I have my own self managed vps and noticed a lot of login attempts using a lot of server resources. Since i’m on cloudflare (free) i enable cf access. Put it in front of my login pages and it requires a specific email address, then a 6 digit code is sent that email and only then, the login page is accessible. Since then… no more crazy cpu usage, i can run 40 low to moderate traffic elementor sites on a single vps using openlightspeed.
I use CF but unsure if your setup which seems an extra step?
Well it just put a wall that requires a 6-digit code in front of your login page. So your login page won’t get hit by bots since cloudflare act as a bouncer if that make sense. Its like a 2fa before you hit the login page. I don’t even need any recaptcha or 2fa for my login page anymore since only my email and the one of the site owner can access it. Its super easy to setup. Once in place, the user gets redirected to the cloudlfare access page, enter their email, get a code by mail (or can click on “access” button instead) and voila, they can login mormally.
Invisible captcha on forms.
I am about to launch my first big site and business on WordPress but I want to make sure that my login info and payment info is fully protected. What do you guys use to make sure everything is secure?
Wordfence + Cloudflare Access + Cloudflare Firewall. All free.
In addition to the above I also add WP Hide and Security plugin. Let's you rename and hide a bunch of stuff. I also do two factor with Google authenticator, or duo for a couple of larger clients.
Wordfence, 2 factor authentication, change htaccess file to only allow your ip on wp-admin pages
>change htaccess file to only allow your ip on wp-admin pages
Got a good link or tutorial for beginners on this? (thanks)
blocking other IPs to wp-admin will break access to wp-admin/admin-ajax.php which is used to call all the registered wp_ajax_ and wp_ajax_nopriv_ actions. It may work on many websites, but not all of them.
I use All-in-One security. With heavily modified settings. Changes loginpage. And creates a honeypot for loginbots.
And never use the account "admin" be sure to change that, or delete it.
I’ll second this and add change the display name for your admin account to something that’s not the username. Keep your plugins and core files up to date, take frequent backups, and use a child theme.
Yep. AIO Security + Wordfence with 2FA helps me sleep soundly at night.
what's the differences between AIO Security and Wordfence?
I like to do a few things to secure a site.
(8) If some of my plugins are deactivated and not up to date can a site be hacked via those plugins?
WordFence
If you're the only admin, turn on notifications for admin logins, so you get an e-mail every time an admin is logging in.
I'm sure this has been asked many times, but I can't find a definitive guide that explains it. I buy a shared hosting plan and install WordPress, what exactly do I do to secure my website? I'm picturing something like this: You go to cPanel/DirectAdmin and you do 1, 2, 3. You go to your WordPress backend and you do 1, 2, 3.
First, make sure your site is backed up (I do it mainly via plugin the All-in-One WP Migration via pCloud or my hosting's backups). This way, you can restore your site if anything ever goes wrong.
Next, take care of security: install WAF (I use Virusdie and MalCare), plus I add an activity log plugin, like WP Activity Log, as you can track any changes or potential issues on your site.
To further secure your shared hosting WP site, ensure you’re using strong, unique passwords for your cPanel and WP accounts: enable two-factor authentication (2FA) for an extra layer of protection. In your cPanel, disable directory browsing and protect sensitive directories with passwords.
In the WP backend, keep your plugins, themes, and WP core updated to avoid vulnerabilities (in this order).
This really depends on the host's setup.
I would make sure that it is supporting Immunify 360 and that it is enabled and also install the free Wordfence Plugin in WP.
As a host with Immunify360, we frown upon Wordfence because we've see it cause major database corruption issues... one week we migrated 5 new clients who all had the same problem from a number of different hosts.
That is really interesting. Do you have any further details about this? Was Wordfence contacted?
I am not disputing what you said. I want to reevaluate my use of WF. I have been using WF for years, have migrated my site in the past and never heard this before. Could it be incompatibility with another plug-in?
A shared host should already have server level security measures like imunify360. A good security plugin for WordPress is Wordfence, but most times I find it to be just resource heavy and not necessary.
When it comes to your website security, where you host it really matters. I've got my sites hosted with NixiHost, they include free Imunify360 protection that guards against hackers and malware, plus free SSL certificates. Imunify360 with Nixihost is automatically installed in cPanel which allows you to scan and detect malwars easily, SSL certificate is automatically installed on your domain as well, and you can add Wordfence plugin to WordPress easily for extra security and backups. Their firewall catches the bad guys before they even reach your site, which lets me sleep better at night. I learned this the hard way before switching to NixiHost three years ago. The peace of mind from knowing my sites are secure, backed up, and loading quickly is totally worth it. Plus, when issues do come up, having responsive support makes all the difference between a quick fix and hours of stress.
To secure your WordPress website on shared hosting, follow these steps:
I've had a handful of WordPress sites over the years. None of them have been really critical until now. I am launching an e-commerce site and very serious about this project.
I've always had security problems with my WordPress sites. A few months ago I got a virus on my e-commerce site and basically had to start over.
Now I am using the free version of Word Fence. I also am using the free version of Updraft for backups.
In general, I'm also using Nord Password Manager.
I've tried to enable two factor authentication with Word Fence. But it doesn't seem to be working. I can't seem to get the authenticator to play nice with Word Fence.
About once every couple of weeks, I get an email from Word Fence letting me know that there was a login. And it turns out to be unauthorized.
What can I do to lockdown my site? If it means spending money on security options, I'm okay with that. I just want to be taking the right approach.
I basically have the same with free Wordfence and free updraft. I would have occasional security issues, maybe once or twice a year.
However, any security issues ended when I activated 2FA. Have not had an issue since.
Use Wordfence, enable 2FA, and keep everything up to date
Keep it simple.
For me, there's not a better combo than server-level security and utilising Cloudflare's WAF to set up your custom rules, rate-limiting rules, etc... Pretty sure the free version is sufficient in most situations.
But even if you need the pro version, it's like $25 per month & is likely going to do a lot more for your site than a plugin ever would.
Also, not chucking random plugins at problems will greatly decrease the likelihood of some sort of hack/intruder. I can't remember the last time I ever had to deal with a hacked site.
This is a great solution, also look into disabling user enumeration, change the admin URL (make sure it blocks wp-login.php) as that will greatly reduce the amount of admin login attempts if not stop them completely.
Use this! It’s a temporary wordpress plugin that you can use to set your WAF rules for you. Amazing. https://github.com/presswizards/cloudflare-waf-rules-wizard
Looks useful, but for anything related to client sites I make sure they have their own account set up (to ensure they have full access to everything they need to run their site should they choose to leave me or if I die/disappear). Doesn’t take me long to add in the specific rules / settings most clients, whenever I do take on any new ones.
👌 This right here is your best bet. 💯%
Utilize Cloudflare's Zero-Trust Network Access system (it's free for up to 50 users... meaning 50 admins for your site). That will make it so network requests to wp-admin will be authenticated before the request even goes to your server (basically if there's an exploit in WordPress core or plugins, unauthorized users still won't be able to get to the admin area of your site).
WordPress powers a huge part of the web, which also makes it a prime target for attacks.
If your site isn’t properly secured, it’s only a matter of time before vulnerabilities are exposed.
Here are two essential steps every site owner should have in place:
1. Enable Two-Factor Authentication (2FA)
A simple but powerful way to stop the majority of brute-force login attempts.
2. Activate Cloudways Bot Protection
Prevents malicious bots from overwhelming your server or finding weak points.
Still, there are a few commonly overlooked issues that can leave even secure sites vulnerable and we shared the key ones and how to fix them in the comments below!
Additional important security measures:
Securing your WordPress site doesn’t have to be overwhelming and even a few smart changes can make a big difference.
Already secured your site? We’d love to hear what’s worked best for you.
Share your tips below to help strengthen the community.
>Use a Web Application Firewall (WAF)
Can anyone confirm whether the server-level firewall provided by Cloudways is robust enough to eliminate the need for a security plugin like WordFence?
Cloudways provides a server-level firewall through its partnership with Cloudflare (Advanced WAF for premium users) and also uses OS level firewalls (like iptables) for basic protection. This setup does block many common threats, especially at the network level.
However, tools like Wordfence go deeper at the application level (inside WordPress), offering features like:
Login security (2FA, brute-force protection)
File integrity monitoring
Malware scanning specific to WordPress core, plugins, and themes
Detailed traffic insights
So while the Cloudways firewall is strong, it doesn’t fully replace what Wordfence does at the application layer. Think of Cloudways' firewall as your outer wall, and Wordfence as your internal security system. Using both provides layered protection, especially if you’re managing multiple plugins or allowing user interactions.
Hope this answered your question
Yes, it is more than adequate between immunify and fail2ban. WordFence is more trouble than it is worth. I also seem to see people complaining that it has failed to prevent breaches on a fairly regular basis.
Hey r/Wordpress !
I was wondering if everyone could share what the first steps you take to harden your wordpress installation is? For example, here is what I do.
I use WP Security & WordFence together, as it has all of those options you listed, on a software level. There are other options on the server level like ModSecurity, and even closing all ports and allow only direct access to server from CloudFlare IPs. ModSecurity is kind of overkill, and would be best if you had high security type of website, like trading, e-commerce, or other stuff that has to do with finance or money.
Add Procaptcha instead of reCAPTCHA and you'll block more bots.
The /r/WordPress subreddit is not a place to advertise or try to sell products or services.
You're not mentioning a single infrastructure hardening option. You're only as good as the weakest link.
Our server itself and its infrastructure is hardened separately. This thread is only regarding a single wordpress installation.
Sometimes it is not an attacker that brings your site down... 😉
Especially if mutiple admins are involved: install an event tracker. It tells you who did what at which time.
Been using WP Activity Log for a long time for that, but have switched now to WP Admin Audit because I prefer the more modern UI controls.
Simple History is another good one, better than WP Activity Log IMO.
Hey guys, I’m sure everyone has a preferred way to secure their sites. Just looking to expand my knowledge on this area. Which plugins or third party services do you use to build a secure site?
Currently use: WordFence
But I feel there are much more I can do to build a safe site in all senses not just malware or firewall protection.
A WAF, password protect wp-login.php, backups, and constant updating of everything. I personally use wordpressupdater (or wp-cli directly), but I wrote the tool so I not sure if I should link to it. I set it up on the daily cron.
There are plugins to manage updates, and even the wordpress core does it itself, but wp-cli and my tool (among countless other scripts!) provide good notification, integration with Apache, etc, etc.
Of course, harden your php setup!
Wp limit login attempts plugin prevents brute force login attempts.
wp-fail2ban is a must!
Only use top tier plugins. And update daily. Scan logs for hacking attempts and blacklist abusers IP. Consider if your security requirement are WP compatible.
> Only use top tier plugins.
You missed the very first step: decide if you really need a plugin for that. At each and every step of the way, decide if a) you actually require the behaviour you're looking at and b) whether the cost of admission (not just costs of the plugin, but the administrative load of keeping it updated, the chance of the plugin author just ghosting, the chance of the plugin author selling it to someone else who isn't so interested in security, etc) for the plugin is worth the behaviour you think you require.
Because IMHO by far the biggest security hole in the average WordPress site (that is, taking them all together in aggregate, not picking out any given WP site and looking at it) is some clueless admin thinking "oh cool, I can add this then I can do <thing>" without ever thinking "do I really need to do <thing>"?
Examples: leaving duplicator, database reset, etc installed long-term. Any of the creepy visitor tracking stuff. GeoIP redirects. Almost all of these are stupid ideas in the first place, but there's also some really terrible plugins out there that implement them that end up riddled with security problems.
So the very first step is "do I actually need to do this?". Personally, I scale this all the way back to WordPress itself - your first step is deciding if WordPress is actually the right tool for the job. If you're going to be paid to admin and update the content of the site, and it changes infrequently, and needs zero user interaction, then a static site generator is probably a much better choice and effectively eliminates the attack surface.
But if WP is a requirement, really think hard about whether some gizmo provided by some plugin you bought a lifetime license for $30USD for is actually a requirement too.
Update daily?
Millions of sites broke just last month because of WP 5.5:
https://www.searchenginejournal.com/wordpress-5-5-1-maintenance-release/379486/
Many updates will break stuff - even with quality plugins. Rarely is one so urgent that it can't wait a week or two.
Be sure to backup before you update and if possible even consider staging your update first. Hold off on version X.0 and wait for X.1 or even X.2. That's usually when they've worked out the bugs.
Check for vulnerabilities of your plugins regularly.
If the update is fixing a vulnerability, then update immediately.
I used WordFence/sucuri for my websites. I used top level plugins which are popular and keep them up to date.
This really depends on your host and stack you are using. If you use Cloudflare you already reduce a huge amount of bot/hacking traffic. Cloudflare recently announced a service that's specific for WordPress wich I do highly recommend.
The problem with plugins for hardening WordPress is the same as installing anti-virus software on your pc. It makes it slow. On your pc this might not be a problem, but most hosting solutions do not have enough power.
We, at work, stick with a good WordPress specic hosting company, CloudFlare and an internal update manager. Managing hundrets of WordPress sites and our sites haven't been hacked unless there was a serious vunerability on the sites plugins. Wich you can never prevent. Always make sure you have backups.
Do you mind sharing what hosting company is the preferred choice?
Security practices for WP without the use of plugin:
Great list; one thing I’d add is using 2FA. Everything is moving in that direction, as well as having good, off-server, backups.
Sysadmins will have a million methods.
Depending on your hosting platform.
And... how much hair do you have left... cause reading those logs can be daunting.
So, how do I sort through my logs? And with 50 websites hosted, what kind of life does one have?
Whelp, depending on your skillset or industry, there are a few log reader programs one can purchase.
The "depending on your hosting platform" godaddy versus all their various options for hosting. So for this example. Godaddy with managed wordpress hosting (deluxe)
You can use sftp to access your wordpress installation, once looking at your file system you'll locate the directory that has daily log files going as far back as your hosting is configured to do.
Download these text files and begin to bore yourself with "wtf does all this mean".
You can use notepad, but I truly suggest to the untrained... use notepad++ at least this program can help color code the log entries.
You'll do this from time to time, read your logs, but in most cases you are looking for those glaring errors that makes the repetitive entries stick out.
So when a failure, or serious error happens behind the scenes of your wordpress's daily operations, these logs can help explain what's causing those problems.
Now, sysadmins have syslog tools, and graphing tools that help automate reading 100s of logs at once.
Be like a network security geek. You want to be a Log Master!.
One of those tools is capturing packets, and analysis methods used to single out a single user from the massive amounts of data. Those tools rock on.
But for you. Scanning logs, just means locating where they are.
Another example of a different web host is powweb.
They called their logs. Php access logs. Essentially the same as others.
If you obtain a reasonable "software firewall" for wordpress. Wordfense, or WP Defender... or.. the other 500 that are out there.. those create logs too.
I personally have a namecheap hosting package, where within the cpanel to manage my "server", I have about 4 options of logs I can review. From mail service, web, and so forth.
how to secure a wordpress website
Key Considerations for Securing a WordPress Website
Keep WordPress Updated: Regularly update WordPress core, themes, and plugins to patch vulnerabilities. Enable automatic updates if possible.
Use Strong Passwords: Implement strong, unique passwords for all user accounts, especially admin accounts. Consider using a password manager to generate and store them.
Install a Security Plugin: Use a reputable security plugin (e.g., Wordfence, Sucuri) to monitor for threats, scan for malware, and provide firewall protection.
Implement Two-Factor Authentication (2FA): Add an extra layer of security by requiring a second form of verification (like a code sent to your phone) for logging in.
Limit Login Attempts: Prevent brute force attacks by limiting the number of login attempts allowed. Many security plugins offer this feature.
Regular Backups: Schedule regular backups of your website using plugins like UpdraftPlus or BackupBuddy. Store backups offsite to ensure you can restore your site if needed.
Secure Hosting Environment: Choose a reputable hosting provider that prioritizes security and offers features like SSL certificates, firewalls, and regular security audits.
Change Default Admin Username: Avoid using "admin" as your username. Create a new user with admin privileges and delete the default admin account.
Disable Directory Listing: Prevent hackers from viewing your directory structure by adding Options -Indexes
to your .htaccess
file.
Use HTTPS: Ensure your website uses HTTPS by installing an SSL certificate. This encrypts data between your site and its visitors.
Recommendation: Start with a security plugin like Wordfence for comprehensive protection and consider using a managed WordPress hosting service that includes security features. Regularly review your security settings and stay informed about the latest security threats to keep your site safe.
Get more comprehensive results summarized by our most cutting edge AI model. Plus deep Youtube search.