madaxen86

payload plugin import export

by madaxen86
Import, export & migration
v3
^3.37.0
MIT

Overview

Summary generated from the README

Adds import and export buttons to collections in the Payload 3 admin so records can be downloaded or updated in bulk from JSON or CSV files. Parsing and transformation run on the client. It follows Payload access control, supports field selection, and can be configured to exclude collections or restrict who may import.

Features

  • Export collection data as JSON or CSV, honoring current list filters and sorting
  • Import JSON or CSV to update existing items or create new ones
  • Select which fields to include on import and export
  • Flattens nested data such as arrays and tabs in CSV and unflattens it on import
  • Download failed items as CSV or JSON after an import
  • Config options to exclude collections and restrict import with a canImport function

Use cases

  • Bulk edit or translate content for many records in a spreadsheet and re-import it
  • Move collection data between environments using JSON files
  • Export filtered collection data for reporting or review

From the author

A plugin for [Payload CMS 3](https://payloadcms.com) to import and export JSON and CSV files.

Installation

npm i payload-plugin-import-export

23

Stars

3

Forks

0

Open Issues

1 years ago

Last Updated

1.2k

Weekly Downloads

v3.0.20

npm Version

110.1 KB

Unpacked Size

1

Dependencies

GitHub stars

230 since Sep 7

Show data
GitHub stars by day (UTC)
DateStars
Dec 6, 202623
Dec 5, 202623
Dec 4, 202623
Dec 3, 202623
Dec 2, 202623
Dec 1, 202623
Nov 30, 202623
Nov 29, 202623
Nov 28, 202623
Nov 27, 202623
Nov 26, 202623
Nov 25, 202623
Nov 24, 202623
Nov 23, 202623
Nov 22, 202623
Nov 21, 202623
Nov 20, 202623
Nov 19, 202623
Nov 18, 202623
Nov 17, 202623
Nov 16, 202623
Nov 15, 202623
Nov 14, 202623
Nov 13, 202623
Nov 12, 202623
Nov 11, 202623
Nov 10, 202623
Nov 9, 202623
Nov 8, 202623
Nov 7, 202623
Nov 6, 202623
Nov 5, 202623
Nov 4, 202623
Nov 3, 202623
Nov 2, 202623
Nov 1, 202623
Oct 31, 202623
Oct 30, 202623
Oct 29, 202623
Oct 28, 202623
Oct 27, 202623
Oct 26, 202623
Oct 25, 202623
Oct 24, 202623
Oct 23, 202623
Oct 22, 202623
Oct 21, 202623
Oct 20, 202623
Oct 19, 202623
Oct 18, 202623
Oct 17, 202623
Oct 16, 202623
Oct 15, 202623
Oct 14, 202623
Oct 13, 202623
Oct 12, 202623
Oct 11, 202623
Oct 10, 202623
Oct 9, 202623
Oct 8, 202623
Oct 7, 202623
Oct 6, 202623
Oct 5, 202623
Oct 4, 202623
Oct 3, 202623
Oct 2, 202623
Oct 1, 202623
Sep 30, 202623
Sep 29, 202623
Sep 28, 202623
Sep 27, 202623
Sep 26, 202623
Sep 25, 202623
Sep 24, 202623
Sep 23, 202623
Sep 22, 202623
Sep 21, 202623
Sep 20, 202623
Sep 19, 202623
Sep 18, 202623
Sep 17, 202623
Sep 16, 202623
Sep 15, 202623
Sep 14, 202623
Sep 13, 202623
Sep 12, 202623
Sep 11, 202623
Sep 10, 202623
Sep 9, 202623
Sep 8, 202623
Sep 7, 202623
npm weekly downloads

1.1K+407 since Sep 7

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 6, 20261,119
Dec 5, 2026951
Dec 4, 2026904
Dec 3, 2026914
Dec 2, 2026897
Dec 1, 2026899
Nov 30, 2026905
Nov 29, 20261,074
Nov 28, 20261,224
Nov 27, 20261,251
Nov 26, 20261,239
Nov 25, 20261,252
Nov 24, 20261,263
Nov 23, 20261,270
Nov 22, 20261,142
Nov 21, 20261,153
Nov 20, 20261,074
Nov 19, 20261,184
Nov 18, 20261,145
Nov 17, 20261,139
Nov 16, 20261,118
Nov 15, 20261,110
Nov 14, 20261,110
Nov 13, 20261,390
Nov 12, 20261,402
Nov 11, 20261,473
Nov 10, 20261,474
Nov 9, 20261,490
Nov 8, 20261,478
Nov 7, 20261,503
Nov 6, 20261,290
Nov 5, 20261,141
Nov 4, 20261,203
Nov 3, 20261,199
Nov 2, 20261,214
Nov 1, 20261,245
Oct 31, 20261,218
Oct 30, 20261,400
Oct 29, 20261,218
Oct 28, 2026890
Oct 27, 2026987
Oct 26, 20261,016
Oct 25, 20261,125
Oct 24, 20261,039
Oct 23, 2026689
Oct 22, 2026964
Oct 21, 20261,215
Oct 20, 20261,113
Oct 19, 20261,061
Oct 18, 20261,001
Oct 17, 20261,058
Oct 16, 20261,303
Oct 15, 20261,257
Oct 14, 20261,260
Oct 13, 20261,267
Oct 12, 20261,266
Oct 11, 20261,150
Oct 10, 20261,122
Oct 9, 20261,075
Oct 8, 20261,060
Oct 7, 2026987
Oct 6, 2026982
Oct 5, 20261,038
Oct 4, 20261,081
Oct 3, 20261,060
Oct 2, 2026998
Oct 1, 2026844
Sep 30, 2026734
Sep 29, 2026768
Sep 28, 2026751
Sep 27, 2026651
Sep 26, 2026554
Sep 25, 2026497
Sep 24, 2026506
Sep 23, 2026537
Sep 22, 2026548
Sep 21, 2026522
Sep 20, 2026538
Sep 19, 2026571
Sep 18, 2026707
Sep 17, 2026781
Sep 16, 2026763
Sep 15, 2026710
Sep 14, 2026697
Sep 13, 2026691
Sep 12, 2026692
Sep 11, 2026653
Sep 10, 2026601
Sep 9, 2026672
Sep 8, 2026690
Sep 7, 2026712

Each point is npm's rolling 7-day download count.

Health Score

50/100Good

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/768040561-root.svg)](https://payloaddirectory.dev/plugins/768040561-root)
HTML
<a href="https://payloaddirectory.dev/plugins/768040561-root"><img src="https://payloaddirectory.dev/badge/768040561-root.svg" alt="Payload Directory"></a>
Updated Sep 24, 2025Created Mar 6, 2024Published Sep 24, 2025

README

Payload Plugin Import / Export

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.

Note

Current version is for Payload CMS 3. For Payload 2 please install version 0 of this plugin.

Installation

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")
    }),
  ]
});

Config

PROPTYPEDEFAULTDESCRIPTION
enabledbooleantrueEnable/disable plugin
excludeCollectionsstring[]undefinedList of collection slugs to not display the buttons
redirectAfterImportbooleantrueRedirect back to collection after import
canImport(user:unknown) => boolean() => trueRestrict access to import. You have access to the user.

How to use

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.

Selecting fields

On import and export you can select fields.

Filter and sorting exports

The filters set on the collections will also be used for exporting items.

Access control

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.

Localization

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.

File formats

JSON

When importing / exporting JSON the data will be shaped like via the REST API.

CSV

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

idtitlearray.0.title_arrayarray.1.title_arraytab.title_tab
65eFooBarBazBoz

When importing the data will get "unflattened". Make sure to not change any header names.

License

MIT

Similar plugins