paragraphs_import
Paragraphs Import adds a CSV file upload to the Paragraphs field widget, so editors can bulk-create paragraph items from a spreadsheet instead of adding each one by hand.
It is most useful when you regularly have content in a spreadsheet that needs to be added as individual paragraphs items, such as reference lists, FAQ entries, or any repeating, tabular content into paragraph fields.
Features
- Provides a dedicated Paragraphs (with CSV import) field widget that extends the core, stable Paragraphs widget. Your existing paragraph types, form display settings, and edit/closed modes keep working exactly as before.
- Adds an "Import paragraphs from CSV" section to the entity edit form, with a file upload, a "first row is a header" checkbox, and an "Import" button.
- Per-field column mapping: enter one paragraph field machine name per line in the widget settings. The line position is matched to the CSV column in that position.
- If a field allows only one paragraph type, that type is used automatically. If it allows several, a select list lets you choose which one new CSV rows are imported as.
- Optional "remove all existing paragraphs before importing" checkbox, for doing a clean re-import rather than appending to what's already there.
- CSV parsing is handled by the league/csv library, so encoding BOMs and quoting/escaping edge cases in editor-supplied files are handled robustly.
- Because the import UI lives on a dedicated widget, there's nothing to enable or disable per field beyond choosing the widget itself in "Manage form display".
Installation
Install the module through composer, as you would any other Drupal module.
Post-Installation
- Enable the module.
- Go to the "Manage form display" tab of the entity bundle that has your paragraphs field.
- Change that field's widget from Paragraphs (stable) to Paragraphs (with CSV import).
- Open the widget's settings (the gear icon) and fill in:
- Paragraph type for CSV import — only shown if the field allows more than one paragraph type.
- CSV column mapping — one field machine name per line; line 1 maps to CSV column 1, line 2 to column 2, and so on. Leave a line blank to skip that column.
- Save the form display. The "Import paragraphs from CSV" section now appears on the entity's edit form, above the existing paragraph items.
- Upload a CSV file, optionally tick "skip header row" and/or "remove existing paragraphs before importing," then click Import from CSV. The form rebuilds with the new paragraphs added — nothing is saved to the database until you save the entity form itself.
Additional Requirements
- Paragraphs — this module extends its stable widget.
- league/csv — installed automatically via Composer.
Similar projects
The Feeds module and Drupal core's Migrate API can both bulk-import paragraph content, but both require defining an import or migration configuration ahead of time.
Paragraphs Import is meant for the smaller, ad-hoc case: an editor already has a CSV and wants to drop it straight into a paragraphs field from the normal content edit form, without a site builder configuring a migration first.