Table Module — User Guide
Table of Contents
The Table Viewer module is a built-in database management tool inside Advanced Analytics. It allows WordPress administrators to browse, inspect, search, edit, insert, and delete rows in any database table — including both WordPress core tables and custom tables created by plugins or themes.
You need the Administrator role (the
manage_options capability) to access the Table Viewer. Other user roles will not see the menu item or be able to perform any operations.Key Features
- Browse all database tables in your WordPress installation
- View full row details in a modal overlay
- Add new rows to any table
- Edit existing rows with type-aware form fields
- Delete individual rows or use bulk delete
- Search across all columns in a table
- Sort by any column (ascending or descending)
- Export table data to CSV
- View detailed table information (structure, indexes, foreign keys, health)
- Optimize tables to reclaim fragmented space
- Truncate non-core tables
- Drop non-core tables
- Searchable dropdown for quick table navigation
- WordPress core table identification with WordPress icon indicator
Enable / Disable the Module
The Table Viewer is a standalone module that can be enabled or disabled independently of other Advanced Analytics features.
- Navigate to Error Logs → Settings in the WordPress admin sidebar.
- Click the “Tables Options” tab (or scroll to the section headed Tables list options).
- Toggle the “Enable tables module” checkbox.
- Click Save Changes.
Accessing the Table Viewer
Once the module is enabled, find it in the WordPress admin sidebar:
- In the WordPress admin menu, look for the Error Logs main menu.
- Click the “Table viewer” sub-menu item.
- The Table Viewer loads showing the default table (
wp_options).
Selecting a Table
The Table Viewer can display any table in your WordPress database. Use the searchable dropdown above the table list to switch between tables.
How to Switch Tables
- Click the table dropdown (located above the data table, on the left side).
- Start typing the name of the table you want to view. The dropdown filters results in real time.
- Click the desired table from the filtered list, or use ↑ / ↓ arrow keys and Enter to select.
- The page reloads and displays the selected table’s data.
WordPress core tables are marked with a WordPress icon () in the dropdown to help you distinguish them from custom tables.
Browsing Table Data
The main view displays the selected table’s data in a paginated, sortable list table (using WordPress’s native WP_List_Table interface). Each row shows the table’s columns, with long cell values automatically truncated to 100 characters. Truncated values show an ellipsis ([…]) indicator.
Column Headers
Each column header displays:
- The column name from the database
- The column data type (e.g.,
bigint(20),varchar(255),longtext)
The primary key column’s rows include action links beneath the value: View, Edit, and Delete.
Searching Records
Use the Search box on the right side of the table to filter rows.
- Enter your search term in the search input field.
- Click the Search button.
- The table reloads showing only rows where any column contains your search term (case-insensitive
LIKEmatch). - To clear the search, remove the text and click Search again.
LIKE %term% wildcard match.Sorting Columns
All columns in the Table Viewer are sortable. Click any column header to toggle the sort order:
- Click once to sort in ascending order (ASC).
- Click again to sort in descending order (DESC).
A small arrow indicator appears next to the currently sorted column. By default, the table is sorted by the primary key column in descending order.
Pagination & Screen Options
The table displays data in pages. You can configure how many rows are shown per page.
- Click Screen Options in the top-right corner of the admin page.
- Set the “Number of items per page” field to your preferred value (default is 20).
- Click Apply.
The pagination controls at the top and bottom of the table let you navigate between pages. The total number of records and pages is displayed.
Viewing a Record
To see the full contents of a row (including values that are truncated in the list view):
- Find the row you want to inspect.
- Click the “View” link beneath the primary key value in the first column.
- A modal overlay opens displaying all column names and their full values in a table format.
- Click the × button or click outside the modal to close it.
Modal Features
- Copy to clipboard — Click the clipboard icon () to copy the raw HTML content of the row data to your clipboard.
- Share — On devices that support the Web Share API, click the share icon () to share the row data via your device’s native sharing dialog.
Serialized PHP values are automatically formatted and displayed in a readable format.
Adding a New Row
You can insert new rows into any table directly from the admin interface.
- Click the “Add New” button in the page header (next to the table heading).
- A form appears with fields for each column in the table.
- Fill in the values. Auto-increment primary key columns are automatically skipped (the database assigns them).
- Click “Add Row” to insert the record.
Type-Aware Input Fields
The add/edit forms automatically generate appropriate input types based on the database column type:
| Column Type | Input Type |
|---|---|
INT, BIGINT, DECIMAL, FLOAT, etc. |
Number input (with step=”any” for decimals) |
CHAR, VARCHAR |
Text input (max 255 characters) |
TEXT, LONGTEXT, MEDIUMTEXT, TINYTEXT |
Textarea (10 rows) |
DATE |
Date picker |
DATETIME, TIMESTAMP |
Date-time picker |
TIME |
Time picker |
YEAR |
Number input (1900–2100) |
ENUM |
Select dropdown with defined values |
SET |
Checkboxes for multi-selection |
JSON |
Textarea with JSON placeholder |
Editing a Row
- Find the row you want to edit.
- Click the “Edit” link beneath the primary key value.
- The edit form loads with the current values pre-filled.
- Modify the values you want to change.
- Click “Save Changes” to update the record.
Deleting Rows
To delete a single row:
- Find the row you want to remove.
- Click the “Delete” link beneath the primary key value.
- A confirmation dialog appears asking “You sure you want to delete this record?”
- Click OK to confirm. The row is permanently removed from the database.
Bulk Actions
To delete multiple rows at once:
- Check the boxes next to the rows you want to delete. Use the top checkbox to select all visible rows.
- From the Bulk Actions dropdown, select “Delete”.
- Click Apply.
- The selected rows are permanently deleted.
CSV Export
You can export the current table’s data to a CSV file for offline analysis or backup purposes.
- Select the table you want to export.
- Optionally apply a search filter to export only matching rows.
- Click the “CSV Export” button (located above the table, next to the table dropdown).
- A progress bar appears showing export progress.
- Once complete, the CSV file is downloaded automatically.
Table Information Modal
The Table Information modal provides detailed metadata about the currently selected table.
- Click the “Info” button (with the info icon) above the table data.
- A modal opens with four sections of information.
Information Sections
Table Structure
Shows all columns with their properties:
- Column — The column name
- Type — Data type (e.g.,
bigint(20) unsigned) - Null — Whether the column accepts NULL values
- Key — Key type (
PRIfor primary,UNIfor unique,MULfor index) - Default — The column’s default value
- Extra — Additional attributes (e.g.,
auto_increment)
Indexes
Lists all indexes defined on the table:
- Key Name — The index name
- Column — The column the index is on
- Unique — Whether it is a unique index
- Type — The index type (e.g.,
BTREE)
Foreign Keys
Shows foreign key relationships (if any):
- Constraint — The constraint name
- Column — The local column
- Referenced Table — The table being referenced
- Referenced Column — The column in the referenced table
Table Health
Displays table health metrics:
- Optimization status — Indicates if the table needs optimization (has fragmentation)
- Row count — Total number of rows
- Data size — Size of the data in the table
- Index size — Size of the indexes
The Help tab in Screen Options also shows table metadata including engine, version, row format, row count, data lengths, auto-increment value, creation and update timestamps, and collation.
Optimizing a Table
Tables with fragmented space can be optimized to reclaim disk space and improve performance.
- Open the Table Information modal by clicking the “Info” button.
- Scroll to the Table Health section.
- Click the “Optimize Table” button.
- Wait for the optimization to complete. A success or error message appears next to the button.
Truncating a Table
Truncating removes all rows from a table but keeps the table structure intact.
- Open the Help tab from Screen Options and navigate to the “Config” panel.
- Click the “Truncate Table” button at the bottom.
- A confirmation message appears: “You sure you want to truncate this table? That operation is destructive”
- Click OK to proceed. The page reloads with an empty table.
Dropping a Table
Dropping permanently deletes the table and all its data from the database.
- Open the Help tab from Screen Options and navigate to the “Config” panel.
- Click the “Drop Table” button (only visible for non-core tables).
- A confirmation message appears: “You sure you want to delete this table? That operation is destructive”
- Click OK to proceed. The table is removed and you are redirected to the default table view.
WordPress Core Tables
The Table Viewer distinguishes between WordPress core tables and custom tables (added by plugins or themes).
Core Table Protections
- WordPress core tables are marked with a WordPress icon () in the table selector dropdown and the page heading.
- Core tables cannot be truncated via the Table Viewer.
- Core tables cannot be dropped — the “Drop Table” button is hidden for core tables.
- Individual row operations (view, edit, delete) are available on core tables.
Core Tables Include
All standard WordPress tables such as wp_options, wp_posts, wp_postmeta, wp_users, wp_usermeta, wp_comments, wp_commentmeta, wp_terms, wp_termmeta, wp_term_taxonomy, wp_term_relationships, wp_links, and any multisite tables if applicable.
Object Cache Notice
If your WordPress site uses an external object cache (such as Redis or Memcached), the Table Viewer displays a notice at the top of the page:
This alert reminds you that changes made directly to database rows may not be immediately reflected in WordPress if the affected data is cached in the object cache layer.
Help Tabs
The Table Viewer provides contextual help via the WordPress Screen Options → Help tab at the top of the page. Two panels are available:
Help Panel
- Overview of how to use the Table Viewer.
- Instructions for filtering, searching, and selecting tables.
- Notes on bulk operations and destructive actions.
Config Panel
- Table metadata: name, engine, version, row format, row count, average row length, data length, index length, data free, auto-increment value, creation time, update time, check time, and collation.
- Truncate Table button for emptying the table.
- Drop Table button for permanently removing non-core tables.
Multisite Networks
The Table Viewer is multisite-aware. When accessed from the Network Admin context, the table selector dropdown shows all tables in the database, including tables for individual sites in the multisite installation.
The table switching and all operations correctly resolve the admin URL context (site admin vs. network admin) to ensure proper navigation and redirect behavior.
Troubleshooting
Table Viewer menu item is not visible
- Ensure the Tables module is enabled in Settings → Tables Options.
- Verify you are logged in with the Administrator role (or have the
manage_optionscapability). - Check if the menu_admins_only setting is enabled — when enabled, only users with
manage_optionscan see the menu.
Changes to data are not reflected on the site
- If an external object cache is active, flush the cache after making changes.
- Some plugins cache data in transients or custom caches. You may need to clear those as well.
Edit/delete actions result in errors
- The database user defined in
wp-config.phpmust have the appropriate MySQL privileges (SELECT, INSERT, UPDATE, DELETE) on the table. - Tables without a primary key or unique index may behave unexpectedly during edit operations. The Table Viewer falls back to the first indexed column or the first column in the table.
Serialized data appears corrupted after editing
- The Table Viewer does not support safe editing of PHP serialized data. If you need to modify serialized values, use a specialized tool or WP-CLI.
- Always take a backup before editing rows that contain serialized data.
CSV export is slow or fails
- Large tables may take longer to export. The progress bar shows real-time export status.
- Use the Cancel button to abort if needed.
- Consider applying a search filter to reduce the number of exported rows.
See
Table Module Developer Documentation for architectural details, class references, sandbox internals, condition evaluator API, and code examples for extending the Snippets module programmatically.