In this post, I illustrate how to export any pdb_list output as a csv file, which can then be opened by Excel or uploaded to Google Sheets.
Use Case
This is one of a number of pdb_list pages my club uses. We need an annual spreadsheet for the accounting office to bill each member's annual dues to their Villages account.
Note: this post was written before we needed to bill with member number instead of house number, a trivial change.
Solution
Here is the whole page in the classic editor (excluding the text lines above the button):
[wpcode id="6256"]
[wpcode id="6249"]
[pdb_list fields="house_number,last_name, first_name " list_limit="300" orderby="house_number" filter="year_joined<2026"]
That's it, 3 lines, 3 shortcodes.
javascript snippet shortcode: I wrote javascript to export any pdb_list table. I used the free WPCode plugin to put it in my club's WordPress snippet library, accessible with a shortcode: [wpcode id="6256"].
HTML button snippet shortcode: I made the HTML/javascript for the button into a snippet as well: [wpcode id="6249"].
Note 1: I will make these snippets freely available to any Guild supported website through its Guild sponsor. You don't need to know or even see the javascript or HTML.
Note 2: The shortcodes must be used in the order shown. The javascript snippet must be placed before the button snippet or the button will do nothing.
Note 3: The export works with the table displayed on the page, so you need to set list_limit to a high enough number to be certain you get all the members.
