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 templates to help you get started.

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.

Import process

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

Select your CSV file from your local and click on “Start Import” button.

 

You can choose to add new passwords as well as update the existing ones.

Please note that passwords that have the wrong format or miss required information will be skipped during the import process.

Increase password limit

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',
	function ($max_lines) {
		return 30000;
	},
	10,
	1
);

Increase exclusion time

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',
	function ($timeout) {
		return 30000; /*30 seconds*/
	},
	10,
	1
);

Export passwords

You can also export all existing passwords and store them in a CSV file format, including:

  • Passwords of individual content
  • Sitewide passwords
  • Shortcode global passwords (WIP)
  • Master passwords (WIP)

Under Import & Export Password dashboard, switch to Export tab and select which passwords and information to export.

Simply click on “Export” button, you will be prompted to store the generated CSV in your local.

Note: If you have thousands of passwords, it is recommended to export data for each post instead of all posts at once.

Lasted updated on March 4, 2021