Many website owners believe that security is complete after installing a security plugin, enabling SSL, and creating a long password. These steps are important, but they do not answer a more critical question: if one layer of defense fails, how much damage can occur?
This is why modern security is not just about preventing attacks. We also need to limit the impact. In practice, a good website is not one that is impossible to breach, but one that has limited access, a clear change log, and a tested recovery path.
Security Is Not a Race to Find the Best Plugin
Security plugins can help block common attack patterns, log suspicious logins, or alert when files change. However, plugins cannot fix all issues in application code, server configuration, or administrator habits.
WordPress itself places core, plugin, and theme updates as one of the most important security measures. Old components often become entry points because their vulnerabilities are publicly known and can be automatically searched by bots. ([developer.wordpress.org](https://developer.wordpress.org/advanced-administration/security/hardening/?utm_source=openai))
Therefore, a more sensible approach is to build multiple layers of protection:
- Prevent: use maintained components, limit access, and implement strong authentication.
- Detect: keep logs of logins, file changes, and administrator activities.
- Limit: do not grant one account or one process more access rights than necessary.
- Recover: prepare usable backups, not just files that have been copied.
Start with Access Rights, Not the Login Screen
One common mistake is that everyone uses an administrator account because it is considered practical. The problem is, an administrator account can do more than just write articles. It can install plugins, change themes, create new users, and under certain conditions, execute code on the server.
Create accounts based on roles. Editors should only manage content. Writers do not need to change site settings. Developers can have technical access, but they do not have to use the same account for daily tasks. After that, delete old accounts that are no longer in use and periodically review the user list.
This principle is called least privilege: a person is only given permissions that are truly necessary. OWASP ranks broken access control as one of the most serious web application risks because this issue can allow users to perform actions beyond their authority. ([owasp.org](https://owasp.org/Top10/?withanewgraphicdesignandanavailableone-pageinfographicyoucanprintorobtainfromourhomepage.Ahugethankyoutoeveryowasp.orgOWASPTop10-2021Top..=&utm_source=openai))
Add multifactor authentication for important accounts. However, do not stop there. Also check if old accounts are still active, whether unknown login sessions can be revoked, and whether hosting, database, and DNS panel access use different credentials.
Reduce the Website's Ability to Change Itself
WordPress provides a file editor from the dashboard so that administrators can change theme or plugin code directly. This feature is convenient, but it also becomes an attractive target if the admin account is compromised.
For many production websites, disabling the file editor is a sensible choice. Add the following configuration to wp-config.php:
define( 'DISALLOW_FILE_EDIT', true );This configuration does not make the website invulnerable. It only reduces one path that can be used to insert malicious code after an attacker gains access to the dashboard. WordPress also warns that this restriction is not a substitute for protection against file uploads or server access. ([developer.wordpress.org](https://developer.wordpress.org/advanced-administration/security/hardening/?utm_source=openai))
Additionally, remove unused plugins and themes. Inactive components can still contain vulnerabilities and are often forgotten during the update process. Choose plugins from trusted sources, check if the developer still provides updates, and avoid unclear βnulledβ packages.
Secure Coding Remains Important, Even When Using WordPress
WordPress reduces the need to write a lot of code from scratch, but sites often have custom themes, internal plugins, or additional API endpoints. This is where programming errors can still occur.
Do not directly insert user input into database queries. Use the database abstraction functions and prepared statements provided by WordPress. For HTML output, perform escaping according to context so that user-entered text does not turn into JavaScript code. For form data, use nonces and check user capabilities before processing requests.
For example, nonces are not a substitute for permission checks. Nonces help ensure that requests come from the expected flow, but the server still needs to check whether the user is indeed allowed to perform that action. This is a small difference that is often overlooked when features are rushed.
The simple rule is: validate data upon entry, limit access rights before actions are executed, and perform escaping when data is displayed. Do not rely solely on the browser or client-side JavaScript as the only barrier.
Backups Must Be Recoverable, Not Just Look Successful
Backups that have never been tested are just assumptions. Files may exist, but the database could be corrupted, recovery credentials may have expired, or the PHP version and plugins may no longer be compatible when the restore process is performed.
Keep multiple recovery points, including copies of the database and website files. Separate at least one copy from the main server so that attackers cannot delete everything from the same place. CISA recommends encrypted backups, separated or offline, as well as regular recovery testing. ([cisa.gov](https://www.cisa.gov/stopransomware/ransomware-guide?utm_source=openai))
Schedule a simple test every few months: restore backups to staging, check important pages, test logins, ensure images display, and verify that transactions or forms are not broken. Record how long the process takes. This number will help determine whether the recovery plan is realistic when the website is truly in trouble.
If There Are Signs of Compromise, Do Not Immediately Delete Everything
A website that suddenly redirects visitors to foreign sites, creates new admin accounts, or sends suspicious emails should be treated as an incident. Do not rush to delete logs or overwrite all files because that evidence can help identify the source of the problem.
- Temporarily limit access, especially to the dashboard, FTP, SSH, and hosting panels.
- Keep copies of logs and note the time when the first symptoms appeared.
- Change credentials from a device believed to be clean.
- Check for new accounts, cron jobs, plugins, themes, and changed files.
- Decide whether the website needs to be isolated before the cleanup process.
- Restore from a backup made before the compromise, then update all components.
Once the site is back online, conduct a brief evaluation: what access was too broad, what updates were pending, and why suspicious activity was not detected sooner. A simple but practiced incident response plan is far more useful than a lengthy document that is never opened. ([cisa.gov](https://www.cisa.gov/stopransomware/ransomware-guide?utm_source=openai))
What You Can Do This Week
- List all administrator accounts and remove those that are not necessary.
- Update WordPress, plugins, themes, PHP, and hosting components.
- Disable the file editor if not needed.
- Ensure backups include the database and files, not just images.
- Test restore to staging and measure recovery time.
- Check login logs and user changes in the last 30 days.
- Write a one-page emergency steps and contact information for the hosting provider.
Healthy website security is not built from one big decision. It emerges from many small habits that reinforce each other: limited access, careful coding, updated components, checked logs, and truly usable backups. In this way, disruptions may still occur, but the chances of them turning into disasters can be minimized.
Sources & Further Reading
- Hardening WordPress β Advanced Administration Handbook
- WordPress Security β Advanced Administration Handbook
- OWASP Top 10:2021
- A01:2021 β Broken Access Control
- #StopRansomware Guide
β Rio Yotto @rioyotto
