How to Export a WordPress Table to CSV, Excel, and PDF

Updated June 2026 • 7 min read

TableCrafter gives every table an export button that lets site visitors or admins download the visible data in three formats: CSV, Excel (XLSX), and PDF. Each format serves a different purpose, behaves differently under the hood, and delivers a different output file. This guide walks through the full export workflow so you know exactly what to configure and what to expect from each format.

Enabling the Export Button

Export is disabled by default. To turn it on, add export="true" to your shortcode:

[tablecrafter id="1" export="true"]

This renders a toolbar above the table with an Export button. Clicking it opens a small format picker — CSV, Excel, PDF — and triggers the download immediately after selection.

If you want export alongside filtering and search, combine the attributes:

[tablecrafter id="1" filter="true" search="true" export="true"]

The export button will respect whatever active filters are applied at the moment the user clicks it, which is covered in detail in the filtered-export guide.

What Gets Exported: Visible Rows vs All Rows

This is the most important behavioral distinction to understand before going further. TableCrafter has two export modes controlled in the table admin under Export Settings:

For most frontend use cases, Export visible rows only is the right default. It respects the user's intent — if they filtered for orders from March, they expect the March orders in the file, not all 5,000 records.

Both modes apply to all three export formats.

CSV Export: Plain, Universal, Fast

CSV is the simplest format. Each row in your table becomes a line in the file, with cell values separated by commas. The first row is always the column headers as configured in TableCrafter's column settings.

What CSV includes:

What CSV does not include:

CSV is the best choice for importing into other systems — databases, CRMs, accounting tools — because the plain text format is universally compatible.

Excel Export: Structured and Spreadsheet-Ready

The XLSX export produces a proper Excel file using the Open XML format. It opens natively in Microsoft Excel, Google Sheets, LibreOffice Calc, and Numbers.

Compared to CSV, the XLSX file includes:

What XLSX does not preserve:

If your table has a currency column formatted as "$1,200.00" in the browser, the XLSX export stores the raw number 1200 and applies an Excel number format. This is correct behavior — it lets Excel perform math on the values.

PDF Export: Layout-Aware and Print-Ready

PDF export renders the table into a document using a server-side layout engine. The result is a paginated file with headers and footers, suitable for sharing with people who should not be editing the data.

What the PDF includes by default:

PDF-specific configuration options (found under Table Settings > Export > PDF Options):

PDF is the right format when you are sending reports to clients, printing records for compliance, or producing invoices that should not be edited.

Choosing the Right Format

CSV

Importing data into another system. Lightweight, universally compatible, no formatting overhead.

Excel (XLSX)

Handing data to a team member for further analysis. They get a structured spreadsheet with correct data types.

PDF

Sending a formatted report to a client or printing a record. Non-editable, branded, pagination-aware.

Export and Column Visibility

TableCrafter's column visibility settings interact with export in a predictable way: columns hidden via the column picker in the table toolbar are excluded from all exports. Columns hidden in the admin configuration (set to not display) are also excluded. The rule is simple: if a column is not visible in the table, it does not appear in the export.

The exception is the PDF column exclusion list mentioned above, which lets you hide specific columns only from the PDF export while keeping them visible in the table and in CSV/XLSX exports.

Next Steps

With the basics covered, you can move on to more specific export scenarios: restricting who can export via role-based permissions, exporting only filtered rows, customizing the PDF layout with a logo and header, or scheduling automatic exports sent by email. Each of these is covered in dedicated guides in this series.

Ready to try it?

TableCrafter is free on WordPress.org. Pro unlocks inline editing, role-based permissions, and advanced data sources.