Table of Contents
How to create an editable table in WordPress with wpDataTables
Say your sales team keeps a list of open leads on the company intranet, and each salesperson should be able to add a new lead or update a status from the page itself, without access to the WordPress admin. An editable table does that. You turn on editing for the table, choose which user roles may edit, and the table on the page gets buttons to add, edit and delete rows in an edit window.
Which tables can be editable?
Tables stored in a MySQL database can be editable: manual tables, imported tables, and tables built on an SQL query that reads one table. Tables linked to a file, a Google sheet or another source can’t, because their data doesn’t live in your database. The two kinds of database tables differ in setup:
| Table | What you set up |
|---|---|
| Manual or imported table | Only Allow editing. The MySQL table name and the ID column are already filled in, and the table is always editable in the admin. |
| Table built on an SQL query | Allow editing, and check the MySQL table name for editing and the ID column for editing that wpDataTables guesses from the query. |
How do I turn on editing for a table?
Open the table in the editor, go to the Editing tab, turn on Allow editing, choose the editor roles and click Save Changes.
- Open the settings. Go to wpDataTables → Tables, open the table and click the Editing tab.
- Turn on editing. Under Allow editing, turn on Allow front-end editing.
- Check the table and ID. For a table built on an SQL query, check MySQL table name for editing and ID column for editing. wpDataTables usually guesses them right when the ID column is called
id. - Choose who can edit. In Editor roles, choose the user roles that may edit, for example Editor and Author.
- Save the table. Click Save Changes.

Video: turning on front-end editing and opening the Edit entry window.
Next, choose how each column is edited, for example a date picker for dates or a dropdown for a status. Read how to choose editor input types. Hide the ID column from users in its column settings, because IDs don’t mean anything to them.
Which other editing options can I set?
The Editing tab has more options for how users edit the table:
| Option | What it does |
|---|---|
| Edit buttons to be displayed on the front-end | Shows only the buttons you choose, for example only the edit button. The default is All. |
| Show duplicate button | Turn on Enable duplicate button to add a duplicate button that opens the edit window with the data of the selected row, so users can add similar rows quickly. |
| In-line editing and Popover edit block | Allow in-line editing lets users edit a cell with a double click, and Editing buttons in a popover shows the edit buttons above the clicked row. Read inline editing. |
| Users see and edit only own data | Turn on Limit editing to own data only to show each user only the rows they added. Read how to let users edit only their own data. |
How do users edit the table on the page?
Users select a row and click the edit button, or click the add button, change the values in the Edit entry window and click Submit. Add the table to a page with its shortcode, as in how to add a table to a page, and the buttons show above the table for the roles you chose.

The edit window has these buttons:
| Button | What it does |
|---|---|
| The previous and next arrows | Open the previous or next row, switching pages if needed. Unsaved changes are discarded. |
| Apply and add new | Saves the row and opens an empty window for the next one. Hidden when only the edit button is allowed. |
| Submit | Saves the row and closes the window. |
| Cancel | Closes the window without saving. |
wpDataTables checks the values before it saves them. If a value is wrong or the database returns an error, a message names the field to fix. After a successful save, a success message appears.
What are the limits of editable tables?
Editing has a few rules that come from how wpDataTables writes to the database:
What should I remember about editable tables?
Only database tables can be editable. Turn on Allow editing in the Editing tab, always choose the Editor roles, check the MySQL table and ID column for SQL tables, and set an editor input type for each column. Users then add, edit and delete rows on the page in the Edit entry window.
Where can I read more?
These pages go further with editing: