How can we help?

Search for answers or browse our knowledge base.

Table of Contents

How to manually add the WP 2FA encryption key to wp-config.php

WP 2FA encrypts user information, such as 2FA keys, to keep things safe and secure. By default, the plugin saves the private key is stored in the wp-config.php file, however, if there is an issue with writing to the wp-config file, WP 2FA will save it to the database. If this happens, you’ll need to manually retrieve the private encryption key from the database and write it to the wp-config file. This how-to will show you how.

Why is the key stored in the database?

In certain cases, WP 2FA may fail to write the private encryption key in the wp-config file. In the vast majority of cases, this is either due to the WordPress user having insufficient privileges over wp-config or the file being split.

How do I know if WP 2FA saved the key in the database?

When WP 2FA fails to write the private encryption key to the wp-config file, it will display a notification advising you that this is the case.

write key to file now

If you do not see a notification, then WP 2FA has successfully managed to write the encryption key to the wp-config file. You can also verify this by opening your wp-config file and confirming there’s a WP2FA_ENCRYPT_KEY entry.

How to move the WP 2FA private encryption key from the database to the wp-config file

Step 1: Backup the website and database as a precaution
Step 2: Disable the WP 2FA plugin
Step 3: Find and copy the encryption key that is stored in the WordPress database. The option name is wp_2fa_secret_key. On a single site installation the plugin is saved in the wp_options table. On a multisite network, it is stored in the wp_sitemeta table.
Step 4: Add the copied private key to the wp-config.php by adding the following line: define( ‘WP2FA_ENCRYPT_KEY’, ‘your-key-here’);
Step 5: Remove the private key from the database by deleting the entry
Step 6: Re-activate the WP 2FA plugin

Uploading WP 2FA as a zip file in WordPress
WP 2FA in the WordPress plugin repository
Close

Installing WP 2FA Free

Congratulations on taking the first step towards enhancing your WordPress site's security with WP 2FA Free! You're now on your way to protecting your valuable data and ensuring peace of mind. No coding or technical knowledge is required.

 

Below are two ways to install WP 2FA on your website:

Go to your plugin dashboard on your site, then go to "Add New", and then search for WP 2FA.

Download the WP 2FA plugin zip, then select upload in your plugin dashboard under "Add New".

OPTION 1

OPTION 2

Uploading CAPTCHA 4WP as a zip file in WordPress
CAPTCHA 4WP in the WordPress plugin repository
Close

Installing CAPTCHA 4WP Free

Well done you. You're one step closer to safeguarding your WordPress website from spam and automated attacks with CAPTCHA 4WP. You'll be able to effortlessly integrate CAPTCHA into your forms and enjoy a website with enhanced security.

 

Below are two ways to install CAPTCHA 4WP on your website:

Go to your plugin dashboard on your site, then go to "Add New", and then search for CAPTCHA 4WP.

Download the CAPTCHA 4WP plugin zip, then select upload in your plugin dashboard under "Add New".

OPTION 1

OPTION 2

Uploading WP Activity Log as a zip file in WordPress
WP Activity Log in the WordPress plugin repository
Close

Installing WP Activity Log Free on your website

You deserve a pat on the back for choosing to record user actions and changes on your website. That is the first step towards better user accountability, easier troubleshooting of website security, and many other benefits of issues.

 

Below are the two ways to install WP Activity Log on your website:

Go to your plugin dashboard on your site, then go to "Add New" and then search for WP Activity Log.

Download the WP Activity Log plugin zip, then select upload in your plugin dashboard under "Add New".

OPTION 1

OPTION 2

Uploading Melapress Login Security as a zip file in WordPress
Melapress Login Security in the WordPress plugin repository
Close

Installing Melapress Login Security Free

Congratulations on taking control of your WordPress website's security by implementing robust login and password policies with Melapress Login Security. You can change your login page URL, limit failed login attempts, and reset passwords.

 

Below are two ways to install Melapress Login Security on your website:

Go to your plugin dashboard on your site, then go to "Add New" and then search for Melapress Login Security.

Download the Melapress Login Security plugin zip, then select upload in your plugin dashboard under "Add New".

OPTION 1

OPTION 2