Helpful information ...
Implement two-factor login in CMS for administrators in four steps
Set Up Two-Factor Authentication for CMS Admins in Four Steps
Two-factor authentication for CMS admin accounts is mandatory, or at the very least strongly recommended, since a password alone isn't enough anymore. For most business websites, we recommend a TOTP app (Google Authenticator, Microsoft Authenticator), and for critical admin accounts, a physical FIDO2 security key. Leave SMS verification as a last resort. Below you'll find the exact steps to enable it, a comparison of methods, and a safe process for recovering access.
In short:
- Using two-factor authentication is mandatory for admin accounts, and a physical FIDO2 key is recommended for critical access.
- Before configuring anything, it's essential to update the CMS first, create backups, and test the configuration in a staging environment.
- For most users, a TOTP app is the best fit, while a security key is the most resistant to phishing and interception attacks.
- Maintaining a secure configuration includes disabling file editing, keeping everything updated, and restricting access by IP for added security.
- If access is lost, backup codes need to be stored safely, and a clear identity verification and 2FA reset procedure needs to be in place.
Table of Contents
- How to Enable Two-Factor Authentication in a CMS
- TOTP, SMS, or a Security Key: Which Method Is Right?
- Hardening a CMS When Implementing 2FA
- What to Do If an Administrator Loses Access
- What Admins Most Often Learn About 2FA Too Late
- Help with Security Hardening for Your CMS Site
- Sources
- Frequently Asked Questions
How to Enable Two-Factor Authentication in a CMS
Before you start configuring anything, back up the entire site, including the database. Update the CMS core, all themes, and all plugins to their latest versions. Implementing 2FA only makes sense once the system is updated and safely backed up, so that a configuration mistake doesn't put the whole site at risk.
For WordPress, almost always go with a plugin rather than custom code. In the official WordPress.org repository, you'll find several well-maintained solutions tagged "2fa." When choosing one, pay attention to the last update date, the number of active installs, and how responsive the developers are to security reports.
The setup process runs in four steps:
- Choose a plugin and install it in a test or staging environment, not directly in production.
- Generate a secret key for each user account and link it to an authenticator app via QR code or manual code entry.
- Create and save backup codes for every account before 2FA becomes mandatory, since without them, losing your phone means being completely locked out.
- Make 2FA mandatory for all administrator roles, and include editorial accounts based on your risk assessment.
Before rolling the plugin out to every user, test logging in with at least two different devices, such as a phone and a tablet. Also check what happens if a user enters the wrong code three times in a row, and whether the system logs that event. Only move the configuration to production once testing has succeeded in the staging environment.
Expert tip: Always leave one admin account without mandatory 2FA on separately, securely stored hosting for emergencies, until you have a reliable recovery process in place. Use this account exclusively for resolving lockouts, never for everyday work.
TOTP, SMS, or a Security Key: Which Method Is Right?
Choosing a method isn't a matter of taste — it's a balance between risk and practicality. Each of the three main methods fits a different usage scenario.
- TOTP apps (Google Authenticator, Microsoft Authenticator, Authy) generate a code valid for 30 seconds and work without an internet connection on the phone. They're free, easy to roll out, and secure enough for the vast majority of admin and editorial accounts.
- SMS verification is the fastest to implement, but also the most vulnerable. SIM-swap attacks and message interception are real threats, and official EU recommendations explicitly advise using a mobile app or a security key instead of SMS codes, which don't work reliably in some countries.
- Security keys (YubiKey and similar FIDO2-standard devices) offer the highest level of protection, since a physical device can't be intercepted remotely or phished through a fake login page.
Official European recommendations for second factors confirm that physical keys offer a clear security advantage over SMS, especially for protection against phishing.
When deciding, consider three criteria: how sensitive the site's data is, how many administrators have access, and whether your team is willing to adopt additional hardware. An online store handling customers' personal data and payment information needs a security key for the main admin account, while a blog with five editors can safely rely on TOTP.

Hardening a CMS When Implementing 2FA
Two-factor authentication doesn't fix vulnerabilities that bypass the login screen entirely. If an attacker gets access to the file system through a vulnerable plugin, 2FA on the login form does nothing to help.
In the wp-config.php file, set DISALLOW_FILE_EDIT to true, which disables file editing through the admin interface. Make sure you have unique security keys (salts) in the same file, and turn off WP_DEBUG on the production server, since it exposes traces of errors an attacker can easily exploit. Properly configuring this file is the foundation on which it actually makes sense to build 2FA.
Additionally:
- Set file permissions to 644 for files and 755 for folders, and add extra protection for
wp-config.phpthrough server-level rules. - Restrict access to
/wp-admin/by IP address, or with an additional password at the server level where feasible. - Regularly update the core, themes, and plugins, and use a web application firewall (WAF) at the hosting level.
- Log failed logins and automatically block IP addresses after a few consecutive wrong attempts.
General guidelines for WordPress site security confirm that updates, access control, and 2FA work as a whole, not as standalone measures. Because WordPress is one of the most widely used website-building platforms, it's also a frequent target of automated attacks, which is exactly why additional hardening makes sense for every business site.
Expert tip: A 2FA plugin needs maintenance of its own. Include it in your regular update schedule, since an outdated plugin can become the very vulnerability an attacker uses to bypass the protection it was supposed to provide.
What to Do If an Administrator Loses Access
Losing a phone or a hardware key shouldn't mean losing access to the entire site. Backup codes, saved by the user when 2FA is first activated, are the first line of defense. Store them encrypted, for example in a password manager, never in a plain text document on the desktop.
When backup codes are no longer available, follow a clear internal procedure:
- Verify the identity of the person requesting the reset through a channel other than email or a call to a known phone number.
- Require double confirmation, for example through the hosting provider and personal contact with a responsible person at the company.
- Reset 2FA only for that account, never globally across the entire site, and require immediate reactivation right after the reset.
- Log the event in an internal record, so you have a trail for any later audit.
Only one or two trusted people should have the right to reset 2FA, since overly centralized permission increases the risk of abuse. Test the procedure at least once a year, and regularly train support staff so they don't cut corners on identity verification under stress.
What Admins Most Often Learn About 2FA Too Late

The biggest mistake we see with clients isn't the absence of 2FA — it's a half-finished rollout. An admin enables two-factor authentication for themselves but forgets to make it mandatory for other editors who have the same access to the database. Voluntary adoption almost never reaches full coverage, which is why it makes sense to enforce it at the role level, not leave it up to the individual.
The minimum security standard we set for every business project at Moxy Web includes mandatory 2FA for all admin accounts, a security key for the main admin access, and a documented, tested reset procedure. Without that last part, any technical setup is only half a solution. For business projects where customer data security is critical, it's worth handing this over to an agency that also maintains the setup, not just switches it on once.
— Ziga
Help with Security Hardening for Your CMS Site
Implementing 2FA is only part of the story. At Moxy-web, we carry out a complete security assessment of your CMS site, set up two-factor authentication for every admin role, harden the configuration (wp-config.php, file permissions, WAF), and prepare a documented procedure for recovering access if you lose a device or key. Unlike a one-time plugin install that nobody maintains, this is a solution we monitor on an ongoing basis alongside hosting and technical support.
If you manage a business website or store and want security to be more than an afterthought, check out our guide to a secure business website, or reach out directly to Moxy-web for an assessment of your site's current state and a concrete implementation proposal.
Sources
For a deeper technical dive, we recommend the European guidelines on multi-factor authentication, the 2FA plugin repository on WordPress.org, and the EURES portal on two-step login.
- WordPress.org — plugins tagged '2fa'
- EU Trusted Digital Identity — What second factor can I configure my account with?
- Računalniške novice — WordPress: How to Secure Your Website?
Frequently Asked Questions
What is two-factor authentication in a CMS?
Two-factor authentication requires a second, independent proof of identity beyond a password, such as a code from an authenticator app or a physical key, which makes unauthorized access significantly harder even if a password is stolen.
Is SMS verification secure enough for a CMS admin account?
SMS is better than nothing, but it's vulnerable to SIM-swap attacks, so use it only as a fallback option, not as the primary protection for your main admin account.
How does QR code login work with 2FA?
Upon activation, the plugin displays a QR code, which you scan with an app like Google Authenticator; the app then generates a new one-time login code every 30 seconds.
What do I do if I lose access to my authenticator?
Use a backup code saved during activation; if you don't have one, follow your documented internal procedure for identity verification and resetting 2FA for your account only.
Does Moxy-web help set up 2FA for an existing site?
Yes, Moxy-web performs a security assessment, sets up 2FA for every admin role, and prepares a documented access recovery procedure as part of broader CMS site maintenance.
Recommended