Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WordPress Security Tip: Add Google Authenticator 2-step Verification

Last updated on by
Elegant Themes
WordPress Security Tip: Add Google Authenticator 2-step Verification

If you aren’t security conscious, then you should probably see how one of Wired.com author’s digital life was destroyed. After reading that story, we have jumped on board with the 2-step authentication for our Google accounts and most other services that offers this feature. After doing a short search, we were able to find a way to easily enable 2-step authentication in WordPress using Google Authenticator. If you are as security conscious as us, and you value your blog, then you should follow this tip to improve your WordPress security.

Note: Google Authenticator only works on iOS, Android, Windows Phone, webOS, PalmOS, and BlackBerry devices. In other words you MUST have a smart phone, iPod Touch, or a tablet with the respective operating systems.

How Does it Work?

Normally passwords can be cracked. If you are using the same password on numerous websites, a security leak on one put your other accounts in danger. Often people are lazy, and they don’t change their passwords even after they get an email about security compromise on a major site. Well, the 2-step verification is the solution just for that. Even if the hacker knows your WordPress username and password, they will not be able to access your site unless they have a time restrained random security code (provided by Google Authenticator). Because your blog is directly connected with your mobile device, you are the only person who should have access to retrieve the unique code for each login. The unique code expires in a short amount of time for security purposes. Once we are done with this tutorial, there will be an additional field on your WordPress login page like this which will improve your WordPress security:

Google Authenticator WordPress Login

How to Add Google Authenticator in WordPress

First thing you need to do is install Google Authenticator in your device. We are going to use the iOS terminology for the sake of this tutorial, but the process is similar for other devices as well. Visit the App store and search for “Google Authenticator”. Download and Install the application. Now let’s get back to your WordPress dashboard. We will re-visit Google Authenticator app once we are done with the setup on the WordPress end.

Lets install and activate the Google Authenticator plugin for WordPress.

In the WordPress menu, click on Users » Your Profile. You will see Google Authenticator Settings there.

Google Authenticator WordPress Settings

Active – If you check this box, then it means that your blog is now going to use Google Authenticator. (Check this box once you are done with the entire setup)

Relaxed Mode – Normally your google authenticator code expires every minute. Using the relaxed mode will allow you to use one code for upto 4 minutes. We don’t recommend turning this on unless you type very slow. The code is only 6 characters long, so you should be able to do it in 1 minute.

Description and Secret Key – These options are pretty self explanatory. The description will act as your account name in the Google Authenticator app. The secret key is needed if you are not using the QR code. Note: When using iPhone, you can’t spaces in your description. Because in the above screenshot we have a space in our description “WPBeginner Blog”, we will have to use the key to enter the information in our application manually. The QR code will not work. If you want to just scan the QR code, then you have to make your description without spaces like this “WPBeginnerBlog”.

Enable App Password – You need this only if you are using XML-RPC (remote publishing) on your blog. This means WordPress iOS app, or Windows Live Writer. Remember, that enabling that will decrease your overall login security, but if you really like using remote publishing, then keep on using it. Just enable this option and set an application password.

Now that we have the WordPress part configured, lets get back to our iPhone App Google Authenticator. Click on the Google Authenticator app icon and then click on the + icon to add a new account. You will see a page like this:

Google Authenticator Add a Token

1. We recommend that you use time-based one-time passcodes. Time-based codes provide better protection against phishing and keyloggers because each code is only valid for a short amount of time. If you use counter-based codes, you will need to press the refresh button next to the code in the Google Authenticator App each time you use it to advance it to the next code.

2. Scan Bar Code if your description doesn’t have any spaces. Click Show QR code button in WordPress to see the QR code.

2a. For those who have spaces in their descriptions, type your description as your account name.

2b. Type the secret key that you have in your WordPress admin panel.

3. Click Done.

Now when you login, you will see a two-step verification field that asks for Google Authenticator code.

Google Authenticator WordPress Login

This works for multi-author blogs as well. Each author gets their own secret key, so they can set it on their device. What are you waiting for? Use 2 step verification on your blog to improve WordPress security.

Lastly, we recommend everyone to turn on 2-step verification on their Google accounts. You can also configure that with Google Authenticator as shown on this tutorial.


Editorial Staff at WPBeginner is a team of WordPress lovers led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »
  • Lorena Dennison

    I have my wordpress blog set up to receive a SMS code to log in… well my cell phone is shut off and can’t get the SMS Code…. so how can I log in and take that SMS off my blog?

    • http://www.wpbeginner.com/ WPBeginner Support

      You can’t unless you disable the plugin used to enable this two step authentication.

  • Kamran Abdul Aziz

    Aha, Google Authenticator & Authy they always works for me,
    However is there any option where we can force users to use 2 Step verification?

    Am not allowing my users to access the Backend, Their profile & everything is limited to front end only.

    I don’t want them to access their backend & Setup 2 step.

    Any solutions?

  • Brenda

    I installed the two-step google authenticator, both the app and the plugin. I updated the app and now all of the sudden I can’t generate a verification code, and therefore have not been able to login to my WordPress. I have no idea what “login using FTP” or who my webmaster is. I signed up for a free worpress account because I wanted to start a little blog and now it appears to me I have to be a computer wizard to do something so basic, which is login!! Can you please help? And explain it to me like I’m a third grader. I don’t have the tech savviness you all do.

    Thank you in advance

    • http://www.wpbeginner.com/ WPBeginner Support

      You mentioned that you have a free WordPress account. Does your blog address has wordpress.com in it? If that’s the case, then this tutorial is not for you. You need to contact WordPress.com support for assistance.

  • Zulfa Permata Suri

    I have set up two-step authentication for my wordpress blog. Suddenly I cant log-in it said the authentication code that i type is invalid and now I am locked out of my wordpress account.
    Help me please, I want to use my wordpress but I cant log-in T.T

    • http://www.wpbeginner.com Editorial Staff

      Login to WordPress using FTP and delete the plugin.

      • Alyson

        Hi – I lost my phone with my google authenticator on it and now I can’t get into my site. I don’t know how to log in using ftp ..

        HELP?

        Thanks!

        • http://www.wpbeginner.com Editorial Staff

          Contact your webhosting provider. They’re the only one who have your FTP access and can help delete the plugin.

  • Cara Isaacs

    Hey,

    I recently set up two-step authentication for my wordpress blog. Downloaded the google app and it all worked fine with log-in. Then changed the name of my blog and accidentally deleted the google authenticator app and now I am locked out of my wordpress account as it asks for the code yet I cannot generate a code because I can’t access my account to get the key.

    I hope you can help.. PLEASE!

    • http://www.wpbeginner.com Editorial Staff

      Use FTP to delete the plugin.

      • Cara

        Thanks for your reply. I just downloaded the ftp software except it can’t seem to connect to the server. Looks like I will be starting a new blog…

        • http://www.wpbeginner.com Editorial Staff

          Hey Cara. Starting a new blog is not a good solution. Please get in touch with your hosting provider or send us an email. We can help you restore this and get it sorted out.

  • Everett Patterson

    Well I did some research and found that the hosting time may be different than the phone time and may cause issues with the codes.

    I was able to log in to my Cpanel and delete the plugin. I still want to use it though so I added it back in and used the relaxed mode this time. Seems to be working now.

    Thanks for this post, very helpful.

  • Everett Patterson

    Uh Oh. I locked myself out of my site.

    Here’s what I did:

    Added the plugin to my blog
    Activated it, but didn’t check the “Active” box
    Added authenticator to my android
    Scanned the QR code
    Checked “Active” box
    Signed out

    My phone gives me a new code every minute, but none of them work. What now?

    • Austin

      I did this too…. I logged into my host via FTP and deleted the Google Authenticator plugin.

      Then I went through the process again and the plugin/app combo worked like a charm!

      Hope you’re able to get back into your site (if you haven’t already).

  • Maria Muir

    I installed the plugin, followed the simple steps and have now been locked out of my site. I also have the failed attempt log in plugin which has blocked me for 3 failed attempts so now have to wait. I did put in the correct details and authentication code, I tripled checked the installation and settings, all are correct. So why can’t I log back in?

    • http://www.wpbeginner.com Editorial Staff

      Run this plugin in the relaxed mode.

  • Chris Burbridge

    It does concern me that when you install the plugin, you have to activate it user by user. That doesn’t make sense to me. Wouldn’t an administrator want to have it work for all users, otherwise there are holes in the net?

    I have been trying this one, which is really great — http://wordpress.org/extend/plugins/duo-wordpress/ — there’s a free option, and it works similarly. It is very slick, with a smart phone.

    • http://www.wpbeginner.com Editorial Staff

      The reason why Google Authenticator requires each user to enable it themselves is because they have to connect their device with it. Google Authenticator is a great solution if you don’t like paying for a service. We are using it on our site. All we did was send an email to all users and ask them to turn it on.

      Yes it requires a little bit of extra work, but it is surely worth it for a small company like ours. If you have hundreds of people in your team, then it would be worth to automate it with a service like the one you linked.

  • Michael

    This works great with Limit Login Attempts plug in. Great security feature if your blog does not have SSL capabilities.

  • yatin

    i love your site :) very helpful

    what if Google authenticator app got uninstalled by mistake !!!!

    after that how can i login in my wordpress site ?

    • http://www.wpbeginner.com Editorial Staff

      Delete the plugin. Then re-do the process.

  • Gerard

    Good article, good plugin and good subject :)

    Love Authenticator app.

    Kind regards,

    Gerard.

  • http://twitter.com/Umer_Rock Umer Rock

    Buy Syed bro it is not linked to google account ? then why you used google athenticator word , i think it is kind of 2 step verification system only,

    • http://www.wpbeginner.com Editorial Staff

      If you read the post carefully, you will see that the app this plugin uses is called Google Authenticator. Without using that application this would not work. If you actually follow the tutorial and download the application, then you will see that application is made by Google Inc.

  • Hadley

    I was able to successfully set up the Google Authenticator app for myself as an admin on my site, but was not able to set it up successfully for an editor on the same site. On the other user’s profile settings under Google Authenticator, the only options are to hide the Authenticator settings or make the user active with Google Authenticator. There aren’t the same options to type in a site description or view a secret code. After installing the app successfully to the other user’s phone, she was not able to sign in to the site and I’m wondering if this is due to the profile settings. Any advice?

    • http://www.wpbeginner.com Editorial Staff

      Interesting. It is probably best to contact the plugin author and see what the issue could be.

  • Ahmad Awais

    Putting our login authentication in hands of a 3rd party plugin?
    Not more than 5k Downloads! What about its authenticity? Are you using it yourself #justcurious.
    I am happy with .htpaswrd file.

    Should we trust this code?

    Except this a nice plugin for sure.

    • http://www.wpbeginner.com Editorial Staff

      The plugin has low downloads because not many people have jumped on board with this 2-step verification method. If you are happy with .htpaswd, then good for you. Yes, we are using it on our site along with all the other security measures.

  • Dilawer Pirzada

    Buzz! After my great efforts on securing WordPress blog from spammers and hackers, I myself today found a great plugin to stop hackers!

    Thanks for the plugin!

  • http://www.facebook.com/profile.php?id=100003217814224 Santel Phin

    Hi,

    I have completed the setup and it works great. But do I have possibility to choose how to the verification code.

    I did the same setup for my Google account, but it send via SMS in stead. And I do prefer this mode as well if it is possible.

    But I don’t see any setting to chose send via SMS. Hope you can give me an idea if it is possible or not.

    Thanks

    • http://www.wpbeginner.com Editorial Staff

      No the SMS option is not available. Mainly because for that you need a sending service which blogs are not equipped with. There is another plugin called “2-step verification” that has the option to email the code. But no SMS.

  • Navneet Singh

    Plugin looking simple and POWERFUL.!!

  • Saad

    This Will Be Useful For Stopping Brute Force :)

  • Geoffrey Gordon

    Thanks Syed

    WordPress security has always been a big issue in general, so the more educated people are regarding WordPress security the better. This is especially important as people see WordPress as a quick way to get a website up and running. Then one day without warning BANG their website is down by some hacker.

    Busy checking out the Google authentication plugin for WordPress, looks good. I have ask though with all the security plugin’s installed on ones blog plus other plugins it tends to slow down the website. Sometimes its better to code what a plugin can do straight into your blog, rather than keep adding another plugin.

    • http://www.wpbeginner.com Editorial Staff

      This plugin works in the backend, so it will not have an impact on your site’s load time on the front-end.

      • Landfoci

        Good plugin. Thanks your share