This article only applies to Views being directly accessed. It will not work for Views that are embedded using the [gravityview] shortcode.When exporting entries, only the fields configured in the View will be shown. If an user can not see a field by accessing the View, they will not be able to access it by CSV export.
Exporting entries as CSV
In View Settings, check the box named "Allow CSV Access"
Update the View
Go to the View
To export the View as CSV, add "/csv/" to the end of the URL
The URL before: http://the-cupola.dev/view/guest-list/ The URL after: http://the-cupola.dev/view/guest-list/ csv/
When accessed, a file will be downloaded with the entries
The name of the file will be the name of the View by default. The file name can be modified by developers by using this code.
Click "Add Widget" in the View Configuration
Click the widget named "Custom Content"
Click the gear icon to edit the Custom Content widget settings
Edit View ‹ The Cupola — WordPress
In this example, we're using the following HTML to add /csv/ to the View URL.
<a href="./csv/">Download as CSV</a>
We checked the box to "Automatically add paragraphs to content" to give the link more space.
Save the View
Now the link appears in the View. Clicking it will download the entries as CSV.
If the page shows Error 404 when trying to download a CSV file
- Go to your site's Dashboard
- Click on the Settings menu
- Click on the "Permalinks" link in the Settings menu
- Do not make any changes, just click the "Save Changes" button