feat: support XML and CSV exports for form submissions - #2924
feat: support XML and CSV exports for form submissions#2924girishpanchal30 wants to merge 3 commits into
Conversation
Bundle Size Diff
|
|
Plugin build for ad6e823 is ready 🛎️!
|
There was a problem hiding this comment.
Pull request overview
Adds spreadsheet-friendly CSV exports for stored form submissions while preserving the existing WordPress XML format.
Changes:
- Adds CSV generation and format selection.
- Introduces an export-format dropdown.
- Adds PHP and E2E export tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
inc/plugins/class-form-records-export.php |
Implements XML/CSV export handling. |
inc/plugins/class-dashboard.php |
Adds format selection and download behavior. |
tests/test-form-submissions.php |
Tests XML defaults and CSV content. |
src/blocks/test/e2e/blocks/form.spec.js |
Tests XML and CSV downloads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| array( | ||
| 'post_type' => Form_Submissions::FORM_RECORD_TYPE, | ||
| 'post_status' => array( 'draft', 'unread', 'read', 'trash' ), | ||
| 'posts_per_page' => -1, |
|
@girishpanchal30 can you post an output example for this based on submissions on 3 forms? One of the problem of the CSV export to be used in Excel or similar is that, based on the number of forms, the export will contain lots of columns. If the user use one or two forms, the output should be decent. |
E2E TestsPlaywright Test Status: See serial and parallel matrix jobs Performance ResultsserverResponse: {"q25":458,"q50":478,"q75":480.7,"cnt":10}, firstPaint: {"q25":1565,"q50":1692.4,"q75":1799.7,"cnt":10}, domContentLoaded: {"q25":3813.2,"q50":3891.8,"q75":3950.6,"cnt":10}, loaded: {"q25":3815.1,"q50":3893.5,"q75":3952.8,"cnt":10}, firstContentfulPaint: {"q25":4377.5,"q50":4437.75,"q75":4500.1,"cnt":10}, firstBlock: {"q25":15540,"q50":15643.9,"q75":15861.7,"cnt":10}, type: {"q25":27.57,"q50":31.2,"q75":33.84,"cnt":10}, typeWithoutInspector: {"q25":24.43,"q50":25.98,"q75":27.35,"cnt":10}, typeWithTopToolbar: {"q25":38.23,"q50":39.38,"q75":40.66,"cnt":10}, typeContainer: {"q25":18.37,"q50":19.23,"q75":21.8,"cnt":10}, focus: {"q25":149.86,"q50":159.4,"q75":163.79,"cnt":10}, inserterOpen: {"q25":45.03,"q50":47.12,"q75":52.22,"cnt":10}, inserterSearch: {"q25":18.05,"q50":19.59,"q75":21.86,"cnt":10}, inserterHover: {"q25":5.63,"q50":5.81,"q75":6.62,"cnt":20}, loadPatterns: {"q25":1877.76,"q50":1900.63,"q75":1909.84,"cnt":10}, listViewOpen: {"q25":253.14,"q50":275.16,"q75":283.32,"cnt":10} |
|
@Soare-Robert-Daniel, I have attached the exported CSV. Currently, the standard columns are fixed, and the remaining columns are generated dynamically based on the fields added to the form. otter_form_submissions__2026-07-21.csv
|

Closes #2884
Summary
Added the ability to export form submissions as CSV. The export button is now a dropdown that allows users to choose between exporting as CSV or WordPress XML (WXR).
Screenshots
Checklist before the final review