Want a more targeted, accessible way to export a table from WordPress? This tutorial will help you create a link or shortcode to export a table from HTML to Excel for use on WordPress websites, blog posts, and in emails in no time!
The ability to import and export important website data is essential to businesses that rely heavily on databases. But exporting a WordPress file without the tools or know-how can be incredibly frustrating.
Fortunately, in this post, you'll learn how to effortlessly export form entry data from any Formidable Forms View to Excel by just ticking a few boxes. You won't need to use complicated third-party plugins that kind of work, nor will you need to code your own solution to convert an HTML table to excel.
Better yet, you'll be able to add a download link on the front end of your web page so that people can download their own Excel-compatible file from anywhere on your site.
Ready to learn how it works? Let's dig in...
How to export an HTML table to Excel with Formidable Forms
By the end of this tutorial, you'll be able to:
- Add a download link underneath any Formidable View that lets people export the HTML table to Excel.
- Use a shortcode to generate a download link for a View's data anywhere on your site.
- Automatically export any Formidable View on a custom schedule and store the exported CSV file in a custom location on your server.
To set this up, all you will need is:
Here's your step-by-step guide...
1. Create a table View
To control what data gets exported to Excel, you can create a regular Formidable table View.
We'll assume you've already created a form with Formidable Forms that has data you want to export. If you haven't, you can follow these instructions.
Fortunately, it only takes a few simple clicks to set up a Table with Views.
To create a table View, go to Formidable → View → Add New.
Then, you'll need to choose the form you want the data pulled from.
Next, look for the Basic Settings box and check the boxes you want included for your custom fields:
You can then rename columns and rows and use the drag-and-drop feature to customize how they will be displayed on your page.
Finally, click the Create a View button. The Table View will be automatically generated.
Now, you're ready to add the ability to export that data as an Excel file.
2. Configure export functionality and add download link
Next, you'll scroll down to the Metabox → Export View Settings section in View Settings. Click the Show Export Link with View to add a link to export the table to CSV. This link will appear directly after the View as an export button in the form of hyperlinked text.
You can learn more about these settings in the Table View to CSV knowledge base article.
Now, when users click the link you created, a file download will automatically start and all the data from your View will be there when opened in Excel:
Other options to export a table to Excel
Looking for other ways to access the WordPress database file you exported? The Formidable Forms WordPress plugin also lets you link to exported data with shortcodes you can insert on any page of your website.
If you'd prefer this approach, you can use the following shortcode:
[frm-export-view view=25 label="Download This Data in Excel"]
Make sure to replace the number (25) with the actual ID for your View. You can also customize the text by editing the label so it flows as text.
Here's an example of what it might look like:
Finally, you can also automatically export your table data on a frequency that you specify and then store the exported CSV files on your WordPress site's server. This is great for backups, daily digests, and anything else where having a snapshot of your data comes in handy.
To set this up, go to Formidable → Global Settings → Export View and:
- Choose the View(s) that you want to automatically export.
- Pick your export frequency, either in days or months.
- Configure basic formatting choices, like the character format and column separators.
- Enter a custom directory on your WordPress site's server (if desired).
Start exporting tables to Excel today
With Formidable Forms and the Table View to CSV Converter add-on, you can easily export tables to Excel and create a simpler workflow for yourself, members of your organization, and/or visitors to your website.
The Table View to CSV Converter add-on is available on the Formidable Forms Business plans and above. You can download the add-on from your Formidable Forms dashboard or by visiting Formidable → Add-ons in your WordPress dashboard.
If you're not on the Formidable Forms Business plan yet, check out all the helpful form builder features to learn why Formidable Forms is the best WordPress form builder plugin to have in your toolbelt.
Richard Best says
Hi. This looks awesome. Can you please let me know whether this will work with repeater fields? In other words, how would multiple repeated fields be added to the view and export? Wouldn't they share the same field IDs for the entries?
Richard Best says
Sorry. On further reading elsewhere, it seems I'd use the foreach shortcode. However, I still have a question please. What I'm keen to do is use a single form submission, with multiple repeater sections across a number of topics, to produce a risk matrix from the parent form submission. I'd like to be able to show that submission as a single entry view, with each child submission populating a new row in a table. I'd then like to be able to export that view to CSV/Excel, so that when the file is opened in Excel, the child entries all appear in their own rows. Is that possible please? Thanks.