How to extend 2FA (OTP) timeout

Shield Security's 2FA timeout defaults to 5 minutes. This means that a user must supply their 2FA code(s) within this time or they'll need to start again (re-login).

So, when you login, you must provide your authentication code(s) to complete the login process. If you don't, you can't do anything until the login expires - which defaults to 5 minutes.

Some email providers can be a bit slow at times with their email delivery, and 5 minutes isn't long enough. To provide a bit more time, you can use a filter to extend the timeout to as many minutes as you need.

You can add this filter to your functions.php or anywhere you feel most appropriate.

To do this, please follow these steps (example, adding filter to your Twenty Twenty theme functions.php file):

  1. Log into your FTP space for this website (we use Filezilla)
  2. Browse to your active theme folder ./wp-content/themes/your-active-theme
  3. Locate functions.php file:

  4. Right click on this file and select to View/Edit

  5. Open this file and add filter (these lines):
    https://gist.github.com/paulgoodchild/870d8b6805662b0de6c75ed1966385ae
  6. Change timeout from 5 to i.e. 10 minutes:

  7. Click to save file changes

2FA timeout will be extended from 5 to 10 minutes:

Note: ShieldPRO is required for this feature. To find out what the extra ShieldPRO features are and how to purchase, please follow this link here.