1. Home
  2. Docs
  3. Index
  4. Shortcodes
  5. Shortcode ‘wpdataaccess’

Shortcode ‘wpdataaccess’

Use shortcode wpdataaccess to show database tables and views on your website. jQuery DataTables is used to provide dynamic HTML tables supporting pagination, sorting and searching. Choose between flat and responsive tables.


You need to explicitly grant access to tables shown on your website! Your table and view data will not be shown on your website without this step! Follow these steps to grant access to a table or view you allow users to add it’s content to your website:

  • From the menu click “WP Data Access” > “Manage Plugin”
  • Click on tab “Front-End Settings”
  • Click on the table or view your want to grant access to (multiple selections possible)
  • Save your front-end settings

Shortcode Parameters

The following parameters are supported:

  • pub_id (publication id)
  • database (schema name)
  • table (table or view name)
  • columns (comma seperated list of columns, default: * = all columns)
  • sql_where (filter: SQL syntax)
  • sql_orderby (ordering, for example: 4,desc)
  • responsive (yes or no, default: no)
  • responsive_cols (number of columns shown on the table, default = 1)
  • responsive_type (modal, collapsed (default) or expanded)
  • responsive_icon (yes or no, default: yes)

Data Publisher

You can use the Data Publisher to create a publication. Every publication created with the Data Publisher tool has a unique publication id (pub_id). If you add parameter pub_id to your shortcode, all other parameters are taken from your publication. No further action is needed. The shortcode for a specific publication can be copied to your clipboard with the Data Publication tool and looks like:

[wpdataaccess pub_id="17"]

User defined shortcodes

You can also add a shortcode manually. For manually added shortcodes parameter table is mandatory. All other parameters are optional. Tables are shown in flat format by default. In it’s simplest form usage looks like:

[wpdataaccess table="wp_customers"]

Was this article helpful to you? Yes No 1

6 Replies to “Shortcode ‘wpdataaccess’”

  1. This is a great addition. I tried using a view I created table=”qEvents” and it worked. However when I tried to add more parameters it ignored them. For instance, this made no difference from the basic table view. Is the syntax correct?
    [wpdataaccess table="qEvents" responsive_type="Collapsed" sql_where="State='WA']

  2. Hi Bob,

    I’m on holiday until january 2nd. I’ll answer your question after my holiday. Hope you don’t mind!

    Best regards,

  3. Aren’t you missing a quote at the end?
    [wpdataaccess table="qEvents" responsive_type="Collapsed" sql_where="State='WA']


  4. Is there a way to disable things like search and/or pagination when using a User Defined Shortcode? I can disable the search through the CSS by hiding it, but hiding the pagination would block the user from getting to the next page.

  5. Hi Bob,

    Sorry for letting you wait for so long! I was on holiday.

    Did you solve the shortcode problem? Have you tried Nic’s suggestion? Thank you Nic!

    It might be a good idea to use the Data Publisher, which gives much more control over all the different options. Not all options supported by the Data Publisher are available from the shortcode.

    Best regards,

  6. Hi Nic,

    You cannot disable options with shortcode arguments, but you can use the Data Publisher. From the Data Publisher you can basically use all options available for jQuery DataTables. Just create a new publication from the Data Publisher and copy the publication shortcode into your webpage. That’s all!

    You can find the documentation here: https://wpdataaccess.com/docs/documentation/data-publisher/how-to-setup-and-use-the-data-publisher/

    Don’t forget to authorize the table(s) you want to use on your we pages (menu: WP Data Access > Manage Plugin > Front-end Settings).

    Best regards,

Leave a Reply

Your email address will not be published. Required fields are marked *