Password CSV Importer and Exporter

Password Suite extension allows you to import hundreds of passwords from an uploaded CSV file. It will add passwords with basic information, including password type, usage limit, and password expiry.

In this article, we will show you how to import and export passwords to and from your website using Password Suite.

Requirements:

Import Passwords

In order to import passwords, you need a CSV file containing your password information.

Create a CSV file

Here are 2 sample CSV file template to help you get started with.

For Individual Pages and Posts Passwords

  • password (required): unique, no space, case-sensitive and limited to 100 characters
  • post_id (required): which post will be protected by these passwords. You can get the ID number by hovering over the desired post title.
  • type (required)
    • Auto: everyone can use this password.
    • Role_x (e.g. Role_administrator; Role_editor): only specific user roles can use this password. Multiple roles are separated by a semicolon (;)
  • label: extra information for your password, e.g. what it is used for
  • is_activated
    • 1 if this password is active
    • 0 if this password is inactive
  • expired_date (integer) the number of days after imported this password will expire.
  • usage_limit (integer) the maximum number of times this password is used

For Sitewide Passwords

  • password (required): unique, no space, case-sensitive and limited to 100 characters
  • label: extra information for your password, e.g. what it is used for
  • is_activated
    • 1 if this password is active
    • 0 if this password is inactive
  • expired_date (integer) the number of days after imported this password will expire.
  • usage_limit (integer) the maximum number of times this password is used
  • redirect_url: where users will be redirected once entering this password

Please note that passwords that have the wrong format, duplicate with existing ones, or miss required information will be skipped during the import process.

Import process

After activating our plugins, navigate to Password Protect WordPress >> Import & Export sub-menu from your admin dashboard.

Select your CVS file from your local and simply click on “Start Import” button to add passwords into your site.

  • Our plugin allows you to import up to 10.000 passwords at once. To increase this default value, simply add the following code snippet into your (child) theme functions.php file.
add_filter('ppwp_ps_import_max_lines', 'ppwp_ps_increase_max_lines', 10, 1);
function ppwp_ps_increase_max_lines($max_lines)
{
	return 30000;
}
  • If you increase the maximum number of imported passwords, you might need to increase the default execution timeout too. The longer the timeout time, the more passwords imported. To do so, add the following code snippet into your (child) theme functions.php file.
add_filter( 'ppwp_ps_http_client_timeout', 'ppwp_ps_increase_http_client_timeout', 10, 1 ); 
function ppwp_ps_increase_http_client_timeout( $timeout ) 
{ 
	return 30000; 
}

Export passwords

You can also export all created passwords and store them in a CSV file format.

Under Import & Export Password dashboard, switch to Export tab and select which passwords you want to export. Simply click on “Export” button, you will be prompted to store the generated CSV in your local.

Lasted updated on September 29, 2020