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 a CSV file from your local and click on the “Start Import” button.

 

You can select the import type, either adding new passwords or updating 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 execution timeout

If you increase the maximum number of imported passwords, you might need to increase the default execution timeout too. The longer the timeout duration is, the more passwords imported. To do so, add the following code snippet to your (child) theme functions.php file.

add_filter(
	'ppwp_ps_http_client_timeout',
	function ($timeout) {
		return 30000; /*30 seconds*/
	},
	10,
	1
);

Export passwords & quick access links

You can also export all existing passwords and quick access links to a CSV file, 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.

Column Property Notes
Post ID post_id ID of a password protected content
Post title post_title Title of a password protected content
Password password Password used to unlock a protected content
Quick access link access_link Link used to access the content directly without entering a password
Label label Extra information for a specific password
Type type
  • Auto if everyone can use the password
  • Role_x (e.g. Role_administrator; Role_editor) if only specific user roles can use the password. Multiple roles are separated by a semicolon (;)
Is activated is_activated
  • 1 if the password is active
  • 0 if the password is inactive
Usage usage The number of times the password has been inputted
Usage limit usage The maximum number of times the password can be used
Created date created_date The date and time the password has been created
Expiration date expired_date The number of days after export the password will expire

Simply click on the “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 16, 2021