Saltar al contenido
WordPress.org

España

  • Temas
  • Plugins
  • Noticias
    • Documentación
    • Foros
  • Acerca de
  • Patrones
  • Eventos
    • Equipo
    • Manuales
  • Consigue WordPress
Consigue WordPress
WordPress.org

Plugin Directory

Google Authenticator

  • Envía un plugin
  • Mis favoritos
  • Acceder
  • Envía un plugin
  • Mis favoritos
  • Acceder

Google Authenticator

Por Ivan
Descargar
  • Detalles
  • Valoraciones
  • Instalación
  • Desarrollo
Soporte

Descripción

Google Authenticator adds a second step to the WordPress login. After their password, users enter a 6-digit code from an authenticator app on their phone, so a stolen password alone is no longer enough to get in.

It works with Google Authenticator and any other app that supports time-based one-time passwords (TOTP), such as Microsoft Authenticator, Authy, 1Password, Bitwarden or KeePassXC.

Features

  • Per-user two-factor authentication. Each user turns it on from their profile and scans a QR code with their app.
  • Mandatory 2FA by role. Administrators can require it for chosen roles, such as Administrator and Editor. Users with any of those roles are sent to a setup page until they have enrolled. On multisite this can be set per site or for the whole network, and the network settings can also require it for all Super Admins.
  • Brute-force protection. After 5 wrong codes sent with the correct password, further attempts are blocked for 1 minute, doubling with each further wrong code up to 1 hour.
  • Replay protection. Each code can only be used once.
  • Two-screen sign-in (optional). Ask for the code on a second screen after the username and password.
  • Relaxed mode for phones whose clock drifts, accepting codes from up to 4 minutes either side.
  • App passwords for XML-RPC clients that can’t ask for a code.
  • Admin controls. Administrators can turn two-factor authentication off for a user, or hide the settings from them.

Please note that turning on the App password feature lowers the security of that account: XML-RPC logins with an app password don’t need a code, only the long app password.

Agradecimientos

Agradecimientos a:

Kuba (Wordfence) for responsibly disclosing an XML-RPC app password authentication bypass.

Miguel Méndez Z por informar de forma responsable sobre una vulnerabilidad de bloqueo de cuenta por CSRF.

Oleksiy por una corrección de fallos en multisitio.

Paweł Nowacki por la traducción al polaco

Fabio Zumbi por la traducción al portugués

Guido Schalkx por la traducción al holandés.

Henrik.Schack por escribir y mantener las versiones de 0.20 a 0.48

Tobias Bäthge por su código de reescritura y traducción al alemán.

Pascal de Bruijn por su idea del «modo relajado».

Daniel Werl por sus consejos de usabilidad.

Dion Hulse por su corrección de fallos.

Aldo Latino por su traducción al italiano.

Kaijia Feng por su traducción al chino simplificado.

Alex Concha por sus consejos de seguridad.

Jerome Etienne por su plugin jquery-qrcode.

Sébastien Prunier por su traducción al español y francés.

Capturas

The login form with the Google Authenticator code field.
The login form with the Google Authenticator code field.
The Google Authenticator section on the Profile page.
The Google Authenticator section on the Profile page.
The QR code on the Profile page.
The QR code on the Profile page.
The Google Authenticator app on Android.
The Google Authenticator app on Android.
An example QR code to scan with your authenticator app.
An example QR code to scan with your authenticator app.

Instalación

  1. Make sure your server’s clock is accurate (for example, that an NTP service is running). The codes are time based, so a wrong server clock means codes won’t match.
  2. Instalar y activar el plugin.
  3. Go to Users → Profile and find the Google Authenticator Settings section.
  4. Scan the QR code with your authenticator app, or type in the secret (choose «time based»). You may also want to write the secret down and keep it somewhere safe.
  5. Tick Active, type the code your app shows into Authenticator Code and click Update Profile. Google Authenticator is only turned on if the code is right, so a mistake when adding the site to the app can’t lock you out.
  6. Optional: go to Settings → Google Authenticator to require two-factor authentication for certain roles or to turn on two-screen sign-in. On multisite, network-wide settings are under Network Admin → Settings → Google Authenticator.

FAQ

Which authenticator apps can I use?

Any app that supports time-based one-time passwords (TOTP), including Google Authenticator, Microsoft Authenticator, Authy, 1Password, Bitwarden and KeePassXC. Several of these also run on a computer, so a smartphone isn’t required.

Can I use it with apps that log in over XML-RPC?

Yes. Enable the App password feature on your profile, click Create new password, and use that password in the app. Note that XML-RPC logins with an app password aren’t protected by a verification code, only by the long app password.

Does two-factor authentication apply to WordPress Application Passwords (REST API)?

No. WordPress’s built-in Application Passwords (under Users → Profile → Application Passwords) are used by REST API clients and don’t go through the login form, by WordPress’s design. They can only be created by someone who is already logged in. If you don’t use them, you can turn them off with the wp_is_application_passwords_available filter.

I can’t log in. What’s wrong?

The codes are time based, so the clock on your phone must match the clock on your web server. Make sure your phone sets its date and time automatically, and that your server’s clock is correct.

You can also enable Relaxed mode in your profile, which accepts codes from up to 4 minutes either side.

I’m locked out. How do I get back in?

  • Another administrator can untick Active in the Google Authenticator section of your user’s edit page.
  • With WP-CLI: wp user meta update <your-username> googleauthenticator_enabled disabled
  • With SFTP or SSH access, rename or delete the wp-content/plugins/google-authenticator folder. You can then log in with your username and password, and put the plugin back afterwards.

It says «Too many incorrect Google Authenticator codes». What now?

Wait for the time shown and try again. Blocks start at 1 minute and double with each further wrong code, up to 1 hour. A successful login resets the count.

Only wrong codes sent together with the correct password count. If you didn’t cause the block yourself, someone else knows your password: change it.

Can I create backup codes?

The plugin doesn’t generate backup codes. Use an authenticator app that backs up or syncs your accounts (Google Authenticator can sync to your Google account, and Microsoft Authenticator, 1Password and Bitwarden have backups too), and keep a copy of your secret somewhere safe. An administrator can also turn two-factor authentication off for your account.

I want to change my secret. Do I just scan the new QR code?

Click Create new secret, scan the new QR code, type the code your app shows for it into Authenticator Code and click Update Profile. The new secret is only saved if the code is right; after that you can delete the old entry from your app.

Does it work with multiple users?

Yes. Each user has their own secret and settings.

Are there hooks for developers?

  • google_authenticator_needs_setup (filter): whether the current user must set up two-factor authentication.
  • google_authenticator_allowed_failed_codes (filter): wrong codes allowed before attempts are blocked. Default 5.
  • google_authenticator_lockout_duration (filter): length of a block in seconds. Default 60, doubling up to 3600.
  • google_authenticator_failed_code (action): fires when a wrong code is sent with the correct password.
  • google_authenticator_code_reused (action): fires when a code that was already used is sent again.
  • google_authenticator_default_description (filter): the description suggested for a user’s entry in their authenticator app. Default: the site name. For example, to tell several accounts on the same site apart: add_filter( 'google_authenticator_default_description', function ( $description, $user ) { return $description . ' (' . $user->user_login . ')'; }, 10, 2 );
  • google_authenticator_hide_settings (filter): whether to hide the Google Authenticator settings from a user’s profile page. Receives the user’s «Hide settings from user» setting and the user ID, so you can hide them for whole roles or for everyone. The mandatory setup page is always shown.

Wrong codes also fire WordPress’s standard wp_login_failed action, so login-limiting plugins see them.

Any known incompatibilities?

Yes. The replay protection isn’t compatible with the test/setup mode of the «Stop Spammer Registrations» plugin. Untick its «Check credentials on all login attempts» option before installing this plugin.

Reseñas

So glad to see this updated – been using it for years!

Paul 7 de abril de 2026
Hi Ivan, thanks so much for the update! I've used this for years and even started patching it myself to keep it compatible with newer PHP versions. So glad to see you’re still supporting it. Much appreciated!

Great

Trần Quân 30 de marzo de 2024
Great plugin, but I wish to use a QR code for scanning when I log in.

Simply a missing feature in .ORG

Bart Bak 4 de mayo de 2023
Works! Uses WordPress UI, is super lightweight, not overdesigned, and is trivial to set up. Great job!

error

ntalam 30 de abril de 2023
Fatal error: Uncaught Firebase\JWT\BeforeValidException: Cannot handle token prior to 2023-04-30T20:30:33+0000 in …\one-tap-google-sign-in\includes\vendor\firebase\php-jwt\src\JWT.phpI understand it requires synchronization, but you need to handle this error properly. Cheers

Works as expected

jjbbrr 22 de diciembre de 2022
One of my sites got hacked and some spam blogs posted. Don't know how they got access but decided to add 2FA as a preventative. Implemented for all authors. Works out of the box, simple interface without lots of bells and whistles.

Plugin stopped working

sianvdheide 21 de octubre de 2022 2 respuestas
Since a few days the plugin stopped working. It used to work perfect. Users who have Google Authenticator activated can't login anymore. They get the message that their username/password is invalid while it isn't. They're able to login again when I deactivate Google Authenticator in their profile. Is this a known bug, if so, how to fix this? Thanks in advance.
Leer todas las 135 reseñas

Colaboradores y desarrolladores

«Google Authenticator» es un software de código abierto. Las siguientes personas han colaborado con este plugin.

Colaboradores
  • Ivan

«Google Authenticator» está traducido en 17 idiomas. Gracias a los traductores por sus contribuciones.

Traduce «Google Authenticator» a tu idioma.

¿Interesado en el desarrollo?

Revisa el código , echa un vistazo al repositorio SVN o suscríbete al registro de desarrollo por RSS.

Registro de cambios

0.59

  • Turning on Google Authenticator from the profile page, or saving a new secret while it is on, now needs a code from your authenticator app, so a mistake when adding the site to the app can no longer lock you out. Administrators can still turn it on for other users without a code.
  • On multisite, the network settings can now require 2FA for all Super Admins, including those with no role on a site.
  • Codes copied from an authenticator app are now accepted with any separator between the digits, such as «012 345», «012-345» or the no-break and thin spaces some apps and phones insert. Previously any space made a valid code fail.
  • New filters google_authenticator_default_description and google_authenticator_hide_settings, and «Hide settings from user» no longer hides the mandatory setup page.
  • Fixed the spelling of the «Successfully saved» settings messages, so they are now translated too.
  • Translations: the new strings are translated into all 24 languages. Like the rest, they are machine-assisted, so corrections from native speakers are welcome on translate.wordpress.org.

0.58

  • Security: Wrong verification codes are now rate limited. After 5 wrong codes sent with the correct password, further attempts are blocked for 1 minute, doubling up to 1 hour. Previously the 6 digit code could be brute-forced by anyone who knew the password.
  • Security: The verification code is only checked once the password is correct, and a wrong password and a wrong code now return the same error.
  • Security: The 2FA secret shown on the setup and profile pages can no longer be set from a link (secret fixation).
  • Security: Mandatory 2FA now applies when any of a user’s roles requires it, not only their first role.
  • Security: The setup page can no longer replace the secret of an account that already has 2FA enabled.
  • Security: Errors from other login checks (lockout or captcha plugins) are no longer overridden by App password logins.
  • Hardening: Stricter validation of verification codes and secrets, input unslashing and output escaping throughout.
  • Fixed two screen sign-in for passwords containing quotes or backslashes.
  • Fixed site settings on multisite being editable only when network-wide settings were enforced (the reverse of what was intended).
  • Fixed the network settings page on WordPress 4.5.
  • Login form: the code field now lines up with the username and password fields in every browser. It uses the same markup as WordPress’s own fields; it was slightly narrower in some browsers, such as Safari.
  • Login form: the «leave this field empty» hint is now a help button next to the label (WordPress 7.1 and later), so it can be read on phones and by screen readers.
  • Login form: Safari and password managers can fill in the code automatically, and phones show a number keypad.
  • Login form: the cursor now starts in the username field, as on a normal WordPress login, instead of jumping to the code field. On the two-screen sign-in page it still starts in the code field.
  • Login form: a wrong code shakes the form, like a wrong password does.
  • Codes typed with full-width digits (for example with a Japanese input method) are now accepted in every browser.
  • Fixed the QR code for descriptions or site names with non-English characters. They were encoded incorrectly, so authenticator apps could show a garbled name or reject the code.
  • Fixed the setup page not sending users who already have two-factor authentication enabled back to the dashboard.
  • Updated the list of authenticator apps on the setup page (Google Authenticator, Microsoft Authenticator and Authy) and removed discontinued ones.
  • Removed a stray space at the end of newly generated app passwords.
  • New action google_authenticator_code_reused. The «Man-in-the-middle attack detected» message is now only written to the PHP error log when WP_DEBUG is on.
  • Code cleanup for the WordPress coding standards and Plugin Check: safe redirects, translator comments and text domains, current jQuery methods (no more jQuery Migrate warnings), and removal of obsolete code.
  • Updated the translation template.
  • Translations: added Arabic, Chinese (Taiwan), Czech, Hungarian, Indonesian, Japanese, Korean, Persian, Portuguese (Portugal), Russian, Spanish (Mexico), Turkish, Ukrainian and Vietnamese, and completed and corrected the existing ten languages. All 24 now cover every string. The new and corrected strings are machine-assisted, so corrections from native speakers are very welcome on translate.wordpress.org.
  • Tested with WordPress 7.2 and PHP 7.2 to 8.6.
  • Updated readme and FAQ.

0.57

  • Seguridad: Se ha corregido un fallo que permitía eludir la autenticación, ya que se aceptaba una contraseña de aplicación vacía a través de XML-RPC (CVE-2026-88759). Gracias a Kuba (Wordfence).
  • Al guardar el perfil ya no se guarda ninguna contraseña de aplicación, a menos que se haya generado una.
  • Las contraseñas de aplicación vacías o antiguas (SHA-1 anteriores a 2014) ahora siempre se rechazan y se eliminan. Los usuarios afectados deben crear una nueva contraseña de aplicación desde su perfil.

0.56

  • Corregido: error de bloqueo de cuenta por CSRF.

0.55

  • Compatibilidad mejorada con PHP para versiones PHP 7.4 a 8.5.
  • Corregido problemas de ejecución obsoletos y estrictos en el código del plugin.
  • Mejorada la compatibilidad y seguridad en el manejo de Base32.

0.54

  • Corregido un fallo en multisitio.

0.53

  • Añadida una traducción al polaco

0.52

  • Añadir una traducción holandesa
  • Añadir una traducción portuguesa

0.51

  • Corrección de una regresión que rompió las contraseñas de las aplicaciones.

0.50

  • Nuevo mantenedor ivankk
  • Se incluye condicionalmente la clase base32.

0.49

  • El flujo de registro es más optimizado para usuarios, la pantalla de configuración para administradores.
  • Es compatible con multisitio para activar 2fa por perfil en un sitio y/o en una red.
  • Se ha añadido el filtro google_authenticator_needs_setup para determinar si el usuario necesita activar 2fa.
  • Se ha añadido un proceso de acceso de dos partes que puede solicitar el código 2fa en una segunda pantalla de acceso.
  • Se ha corregido un fallo de seguridad que check_otp continuaba incluso si la identificación ya había devuelto un error.

0.48

  • Corrección de seguridad y compatibilidad con WordPress 4.5

0.47

  • Se ha reemplazado Google chart API con jquery-qrcode
  • Los códigos QR ahora contienen un encabezado que dice WordPress (Solicitud de característica por Flemming Mahler)
  • Se ha actualizado el archivo .pot y la traducción danesa.
  • El plugin ahora registra los intentos de acceso reconocidos como ataques Man-in-the-middle.

0.46

  • Se ha añadido protección contra el ataque del Man-in-the-middle.
  • Mostrar advertencia antes de mostrar el código QR.
  • FAQ actualizadas.

0.45

  • Los espacios en el campo de descripción ahora deberían funcionar en iPhones.
  • Algunas llamadas de funciones obsoletas reemplazadas.
  • El código de campo de entrada es ahora más fácil de usar para los usuarios .jp.
  • Se ha mejorado la entrada del campo de descripción.
  • La función hash de la contraseña de la aplicación cambió a una que no tiene tablas de arco iris disponibles.
  • Se han eliminado los avisos de PHP durante el acceso de la contraseña de la aplicación.

0.44

  • Instalación / sección de FAQ actualizada.
  • Se ha añadido la traducción del chino simplificado por Kaijia Feng.
  • Se ha eliminado Tabindex en la página de acceso, que ya no se necesita, fue utilizado por las instalaciones anteriores de WordPress.
  • Campo de entrada renombrado a «googleotp».
  • La descripción por defecto cambió a «WordPressBlog» para evitar problemas para los usuarios de iPhone.
  • Es compatible con el plugin de Ryan Hellyer http://geek.ryanhellyer.net/products/deactivate-google-authenticator/
  • Debes introducir todos los 6 dígitos del código.

0.43

  • Ahora es posible que un administrador oculte la configuración de Google Authenticator por usuario. (Solicitud de característica por: Skate-O)

0.42

  • Se ha desactivado autocompletar en el campo de entrada de código. (Solicitud de característica por: hiphopsmurf)

0.41

  • Se ha añadido la traducción italiana por Aldo Latino.

0.40

  • Corrección de fallo, corrección de errores tipográficos y avisos de PHP eliminados. Gracias a Dion Hulse por su parche.

0.39

  • Corrección de fallo, la descripción no se guardó en la base de datos de WordPress al actualizar el perfil. Gracias a xxdesmus por darse cuenta de esto.

0.38

  • Corrección de usabilidad, el campo de entrada para códigos se ha cambiado de contraseña a tipo de texto.

0.37

  • El plugin ahora es compatible con el «modo relajado» cuando se identifica. Si se selecciona, los códigos de 4 minutos antes y 4 minutos después funcionarán. 30 segundos antes y después sigue siendo los ajustes por defecto.

0.36

  • Corrección de fallo, ahora una contraseña de la aplicación solo se puede utilizar para los accesos de solicitud de XMLRPC/APP.

0.35

  • Se ha añadido compatibilidad para la aplicación inicial de WordPress (XMLRPC).

0.30

  • Limpieza de código
  • Se ha cambiado la generación de la clave secreta, para que ya no exista el requisito de SHA256 en el servidor.
  • Traducción alemana

0.20

  • Version inicial

Meta

  • Versión 0.59
  • Última actualización hace 3 días
  • Instalaciones activas 20.000+
  • Versión de WordPress 4.5 o superior
  • Probado hasta 7.2
  • Versión de PHP 7.2 o superior
  • Idiomas

    Chinese (China), Czech, Danish, Dutch, English (US), French (France), Hebrew, Italian, Japanese, Norwegian (Bokmål), Persian, Polish, Romanian, Slovak, Spanish (Chile), Spanish (Spain), Swedish y Turkish.

    Traducir a tu idioma

  • Etiquetas:
    authenticationloginotppasswordsecurity
  • Vista avanzada

Valoraciones

4.3 de 5 estrellas.
  • 105 valoraciones de 5 estrellas 5 estrellas 105
  • 7 valoraciones de 4 estrellas 4 estrellas 7
  • 3 valoraciones de 3 estrellas 3 estrellas 3
  • 2 valoraciones de 2 estrellas 2 estrellas 2
  • 18 valoraciones de 1 estrellas 1 estrella 18

Tu valoración

Ver todas las reseñas

Colaboradores

  • Ivan

Soporte

¿Tienes algo que decir? ¿Necesitas ayuda?

Ver el foro de soporte

  • Acerca de
  • Noticias
  • Alojamiento
  • Privacidad
  • Escaparate
  • Temas
  • Plugins
  • Patrones
  • Aprender
  • Soporte
  • Desarrolladores
  • WordPress.tv ↗
  • Involúcrate
  • Eventos
  • Donar ↗
  • Regalos ↗
  • WordPress.com ↗
  • Matt ↗
  • bbPress ↗
  • BuddyPress ↗
WordPress.org

España

The WordPress® trademark is the intellectual property of the WordPress Foundation.

  • Visita nuestra cuenta de X (anteriormente Twitter)
  • Visita nuestra cuenta de Bluesky
  • Visita nuestra cuenta de Mastodon
  • Visita nuestra cuenta de Threads
  • Visita nuestra página de Facebook
  • Visita nuestra cuenta de Instagram
  • Visita nuestra cuenta de LinkedIn
  • Visita nuestra cuenta de TikTok
  • Visita nuestro canal de YouTube
  • Visita nuestra cuenta de Tumblr
El código es poesía.
✕

Wait! Don't Go Yet 🚀

Get our FREE eBook "10 Programming Tips That Changed Everything" when you subscribe!

No spam. Unsubscribe anytime.