How to Show WooCommerce Customers Their Own Orders in a Table

TableCrafter's current-user filter lets you display a WooCommerce orders table where each logged-in customer sees only their own orders, order ID, date, status, total, and items, without any custom code. This guide walks through the filter config, role settings, and how to embed the table in the WooCommerce My Account page. WordPress powers 43% of all websites globally (W3Techs, July 2026), and TableCrafter bridges the gap between the data you collect and the tables your users need to see, no custom PHP, no dashboard access required for viewers, and no per-row limits on the free tier. The free version on WordPress.org supports CSV, JSON, Google Sheets, and Excel. Pro adds Gravity Forms, Airtable, Notion, WooCommerce, REST APIs, inline cell editing, export to CSV/PDF, role-based column visibility, and auto-refresh. Every table embeds on any page with a [tablecrafter] shortcode or the native Gutenberg block. Frontend editing reduces admin support requests by an average of 42% in multi-user WordPress environments (WP Buffs, 2024).
How Does the Current-User Filter Work?
WooCommerce stores the customer's WordPress user ID in the customer_id field on every order. For guest checkouts, customer_id is 0. TableCrafter's Current User filter type adds a WHERE customer_id = {current_user_id} clause to every query at render time. The filter is applied server-side and cannot be manipulated by the browser, a customer cannot modify the URL or form parameters to see another customer's orders.
The column mapping you define here is stored as a JSON configuration in the WordPress database. You can export this configuration using the TableCrafter export tool and import it to another table or another site. This is useful when replicating a table layout across multiple pages or when migrating a table to a staging environment for testing before going live.
customer_id = 0. Those orders will not appear in any user's current-user-filtered table. If your store uses a guest-to-account flow (WooCommerce's "Create account" option at checkout), orders placed before account creation remain guest orders unless manually reassigned.
Step 1: How Do I Create a Customer Orders Table Config?
Go to TableCrafter → Tables → Add New. Set the data source to WooCommerce: Orders. Name the table My Orders, Customer View. This will be a separate table config from your admin-facing order management table, even though both pull from the same WooCommerce orders source.
This step is required before the table can render data. Skipping it or entering incorrect values will result in a connection error when the table first loads. Double-check the value by pasting it directly into the field rather than typing it manually to avoid whitespace or encoding issues.
TableCrafter re-fetches this data on each page load by default. If your data source updates infrequently and your site has significant traffic, enable the built-in caching option in the table's Performance tab. This stores the fetched data for a configurable number of minutes and serves it from WordPress transients, reducing API calls to the source and improving page load time for visitors.
Step 2: How Do I Configure Columns for Customers?
Customers need enough information to track their orders without seeing internal business data. Add these columns:
order_id, Label: Order #. Link to the WooCommerce order detail page (not the admin):/my-account/view-order/{order_id}/order_date, Label: Date, format: MM/DD/YYYYorder_status, Label: Status, Display Type: Badge. Do not enable inline edit.line_item_name, Label: Item(s)line_item_quantity, Label: Qtyorder_total, Label: Total, format: Currency
Do not include billing_email, billing_phone, internal notes, or cost/margin fields. Customers do not need to see their own email in a table, and you do not want to expose data that could be sensitive in a different context.
The configuration you set here applies to every visitor who loads a page containing this table, regardless of whether they are logged in. Role-specific overrides for columns and rows are a separate layer and do not replace these global display settings. Apply global settings first, then add role restrictions as needed for tables that serve multiple user types.
Step 3: How Do I Add the Current User Filter?
Open the Filters tab in the table config. Click Add Filter:
- Source Field:
customer_id - Filter Type: Current User
- Visibility: Hidden (the filter is applied automatically and the customer does not see or interact with it)
Setting visibility to Hidden is important. The filter still runs on every query, but no filter control is rendered in the toolbar. The customer simply sees their own orders with no filter UI to manipulate.
If the result does not match expectations after saving, use the TableCrafter debug log (enable via TableCrafter Settings > Advanced > Debug Mode) to trace exactly which configuration value is being applied for the current request.
This step completes the connection between your data source and the TableCrafter table engine. Once saved, the plugin caches the connection credentials in the WordPress options table and uses them on every subsequent page load. If you update the source configuration later — for example, rotating an API key or changing a sheet URL — return to this step, enter the new value, and save again. The table updates immediately on next load without any shortcode changes.
Step 4: How Do I Set Access Permissions?
In the Access tab:
- Minimum role to view: Customer
- Roles that can edit: None (leave empty)
The Customer role is the default WooCommerce role assigned to registered buyers. If you use a different role for customers (some membership plugins assign a custom role), enter that role name here. TableCrafter checks current_user_can() against the minimum role on every request, both the initial page render and subsequent AJAX filter/sort/paginate calls.
Set No Access Message to something useful, for example: Please log in to view your orders. with a link to /my-account/. Logged-out visitors will see this message instead of the table.
If this step produces unexpected output, check the source data directly in the connected system. TableCrafter passes data through without modification — if a cell displays an unexpected value, the source record contains that value. Use the TableCrafter debug log (Settings > Advanced > Debug Mode) to trace the exact query sent to the source and the raw response received, which narrows the diagnosis to either a source-side or rendering-side issue.
Step 5: How Do I Configure Sorting and Pagination?
Most customers have between 1 and 50 orders. Set Default Sort to order_date descending so the most recent order appears first. Set Rows per page to 10 or 20. Enable pagination controls.
You can also add a visible status filter so customers can filter their own orders by status, for example, to find all their Completed orders. This is optional and depends on your preference for the customer experience.
Test this step while logged in as a user with the target role to confirm the expected behavior. Logged-in admin users always see all columns and all rows regardless of role restrictions, which can mask visibility issues during initial configuration.
The shortcode accepts all column and filter settings defined in the table builder as defaults, but you can override individual parameters inline. For example, `[tablecrafter id="1" per_page="25"]` overrides the default rows-per-page setting for this specific embed without changing the saved table configuration. This lets you reuse one table definition across multiple pages with different display requirements.
Step 6: How Do I Place the Shortcode?
[tablecrafter id="5" search="true"]
Search is useful for customers who want to find a specific order by product name. Export is optional, you may or may not want customers to be able to download a CSV of their order history. If you enable export, the CSV is scoped to their current-user filter, so they can only export their own orders.
The setting is stored in the WordPress options table under the table's configuration key. It does not modify the original data source and can be changed at any time without affecting the underlying records.
This configuration interacts with any caching or CDN layer active on your WordPress installation. If you use WP Rocket, LiteSpeed Cache, or a CDN such as Cloudflare, flush the page cache after making this change to ensure the updated configuration is reflected in the cached HTML served to visitors. TableCrafter's server-side output is regenerated on the next uncached request.
How Does Integrating with the WooCommerce My Account Page Work?
The WooCommerce My Account page is the natural home for a customer orders table. You have two options for embedding it:
Option A: Replace the Default Orders Tab
WooCommerce's default Orders tab in My Account shows a basic HTML table. You can replace it with your TableCrafter table by adding a small amount of code to your theme's functions.php or a site-specific plugin:
// Remove the default WooCommerce orders endpoint content
add_action( 'woocommerce_account_orders_endpoint', function() {
// Remove default handler
remove_action( 'woocommerce_account_orders_endpoint', 'woocommerce_account_orders' );
// Output TableCrafter shortcode
echo do_shortcode( '[tablecrafter id="5" search="true"]' );
}, 5 );
This approach keeps the My Account navigation intact while replacing only the tab content.
Option B: Add a New Tab
Add a new tab to My Account called Order History or My Orders alongside the default tabs. This is less disruptive if you want to keep the WooCommerce default orders view as a fallback. Use the woocommerce_account_menu_items and woocommerce_account_{endpoint}_endpoint hooks to register the new endpoint and output the shortcode.
Option C: Standalone Page
Create a WordPress page titled My Orders, paste the shortcode, and link to it from your theme's navigation or a customer dashboard. The simplest approach and requires no code.
[tablecrafter id="5" search="true"] directly inside the page builder layout without touching PHP.
What Customers See?
A logged-in customer visiting the page sees a clean table showing only their own orders, sorted newest first, with order status badges, product names, and totals. The order number column links to the WooCommerce order detail page where they can see the full order, download invoices, or request a return.
A logged-out visitor sees your configured no-access message with a login link. A shop manager visiting the page also sees only their own orders as a customer, because the current-user filter applies to everyone who views this table config. If shop managers need to see all orders, they use a separate table config without the current-user filter.
After completing this step, verify the result by viewing the page as a logged-out visitor in an incognito window. This confirms the table behaves correctly for public visitors rather than reflecting admin-level permissions that may hide configuration issues during initial setup. Check both the rendered output and the browser console for any JavaScript errors.
Frequently Asked Questions
How Does the Current-User Filter Work?
WooCommerce stores the customer's WordPress user ID in the customer_id field on every order. For guest checkouts, customer_id is 0. TableCrafter's Current User filter type adds a WHERE customer_id = {current_user_id} clause to every query at render time. The filter is applied server-side and cannot be manipulated by the browser, a customer cannot modify the URL or form parameters to see another c
What Is TableCrafter?
TableCrafter is a WordPress plugin that turns data from Gravity Forms, Google Sheets, Airtable, Notion, REST APIs, CSV files, and WooCommerce into interactive, sortable, filterable frontend tables. Embed any table on any WordPress page with the [tablecrafter] shortcode or the native Gutenberg block. No PHP or custom development required. The free version supports CSV, JSON, Google Sheets, and Excel. Pro adds Gravity Forms, Airtable, Notion, WooCommerce, REST APIs, inline cell editing, export to CSV and PDF, role-based column visibility, and auto-refresh.
Does this require PHP or developer skills?
No. TableCrafter is configured entirely through the WordPress admin interface. You choose your data source, map fields to columns, and set display preferences using point-and-click controls. Embedding uses the [tablecrafter] shortcode or the native Gutenberg block.
Is the free version sufficient or do I need Pro?
The free plugin on WordPress.org supports CSV, JSON, Google Sheets, and Excel sources with unlimited tables, rows, and columns. Pro adds Gravity Forms, Airtable, Notion, WooCommerce, REST API sources, inline cell editing, bulk row actions, export to CSV and PDF, role-based column visibility, and auto-refresh every N seconds.
Ready to try it?
TableCrafter is free on WordPress.org. Pro unlocks inline editing, role-based permissions, and advanced data sources.
Changes take effect immediately after saving. No cache flush or page refresh is required for the new configuration to apply to all shortcode instances of this table.
The column mapping you define here is stored as a JSON configuration in the WordPress database. You can export this configuration using the TableCrafter export tool and import it to another table or another site. This is useful when replicating a table layout across multiple pages or when migrating a table to a staging environment for testing before going live.