Exporting contact form entries to a CSV file
A good export gives one row per entry and one column per field, named by the field's label, plus the date and status. It should also be safe to open: a value typed into a public form can start with =, and a spreadsheet will run it as a formula unless the export neutralises it.
Why CSV exports need to be careful
Anyone on the internet can type into your contact form. If someone enters =HYPERLINK("http://…","Click") as their name, and the export writes it as-is, Excel or LibreOffice may treat it as a formula when you open the file. This is called CSV or formula injection, and the standard defence is to put an apostrophe in front of any value that starts with =, +, -, @, a tab or a carriage return, so the spreadsheet shows it as text.
See how a value is written to the CSV export
This tool runs in your browser with JavaScript on; nothing you paste leaves the page.
What Mailbag's export contains
- One column per field, headed by the field's label, then Date and Status.
- Commas, quotes and line breaks inside values quoted the standard way (RFC 4180), so a message with several paragraphs stays in one cell.
- UTF-8 with a byte-order mark, so Excel shows names such as Søren or Zoë correctly instead of garbled characters.
- The apostrophe rule above, on every value.
Opening it
In Excel, open the file directly or use Data → From Text/CSV. In Google Sheets, use File → Import. If a date column looks odd, set the column's format; the file stores the text as your site showed it.
Exporting a whole form, not a whole site
Filter the Entries list to one form before exporting when you need a clean sheet for, say, quote requests only. To move the form itself to another site — not its entries — use the JSON export described in copying a form to another site.
Mailbag Contact Form is a free contact form that saves every entry before it sends anything, and shows you what happened to each email.
See what it does