
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
payload-plugin-import-export
Advanced tools
A plugin for [Payload CMS 3](https://payloadcms.com) to import and export JSON and CSV files.
A plugin for Payload CMS to import and export JSON and CSV files. You can use this to change data for many records e.g. translate content... from collections.
All parsing and transformations are done on the client keeping the load from the server.
Current version is for Payload CMS 3. For Payload 2 please install version 0 of this plugin.
npm i "payload-plugin-import-export"
yarn add "payload-plugin-import-export"
pnpm add "payload-plugin-import-export"
import importExportPlugin from 'payload-plugin-import-export';
import type { User } from "payload/generated-types";
export const config = buildConfig({
serverUrl: process.env.PAYLOAD_PUBLIC_SERVER_URL //Required!
plugins: [
importExportPlugin({
enabled: true,
excludeCollections: ["users"],
canImport: (user:User) => user.roles.includes("admin")
}),
]
});
| PROP | TYPE | DEFAULT | DESCRIPTION |
|---|---|---|---|
| enabled | boolean | true | Enable/disable plugin |
| excludeCollections | string[] | undefined | List of collection slugs to not display the buttons |
| redirectAfterImport | boolean | true | Redirect back to collection after import |
| canImport | (user:unknown) => boolean | () => true | Restrict access to import. You have access to the user. |
Update data or create new items - and you can download csv or json with the failed items. Items fail usually due to permission issues or that required fields are not set.
On import and export you can select fields.
The filters set on the collections will also be used for exporting items.
This plugin obeys all access control rules, so exports will only include the fields with read access. On import missing permission on field level will not result in an error. The fields will just be ignored.
If localization is configured imports and export will be done in current selected locale. Caution: If field is not localized the "global" value will be overwritten.
When importing / exporting JSON the data will be shaped like via the REST API.
For CSV exports the data will be "flattened" for any field type which contains nested data (arrays,rows,tabs). e.g.:
[
{
"id": "65e",
"title": "Foo",
"array": [
{
"title_array": "Bar"
},
{
"title_array": "Baz"
}
],
"tab": {
"title_tab": "Boz"
}
}
]
will become
| id | title | array.0.title_array | array.1.title_array | tab.title_tab |
|---|---|---|---|---|
| 65e | Foo | Bar | Baz | Boz |
When importing the data will get "unflattened". Make sure to not change any header names.
MIT
FAQs
A plugin for [Payload CMS 3](https://payloadcms.com) to import and export JSON and CSV files.
The npm package payload-plugin-import-export receives a total of 554 weekly downloads. As such, payload-plugin-import-export popularity was classified as not popular.
We found that payload-plugin-import-export demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.