wp-admin-list-table

Build WordPress admin list tables by extending WP_List_Table with sortable columns and bulk actions.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/vikingokft/wp-agent-skills --skill wp-admin-list-table
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wp-admin-list-table
Source: https://github.com/vikingokft/wp-agent-skills/tree/main/wordpress/wp-admin-list-table
Command: npx skills add https://github.com/vikingokft/wp-agent-skills --skill wp-admin-list-table

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the challenge of building WordPress admin list tables by extending WP_List_Table while preventing the common bulk-action CSRF and access-control mistakes that can lead to unauthorized record deletion or state changes.

Core Features & Use Cases

  • WP-native admin list UI: sortable columns, bulk actions, row actions, search, pagination, views/filters, and Screen Options per-page handling.
  • Correct plugin integration: explicitly handles the non-autoloaded WP_List_Table class via require_once and documents the required/optional method overrides.
  • Production-grade safety: enforces the nonce and capability contract for bulk actions (and nonce-per-row for row actions) and guides safe ordering via whitelisting/sortable columns to avoid ORDER BY injection.
  • Use cases: license key management, job/log/audit record dashboards, subscription and membership record lists, and any admin “records table” that should match core WordPress UX.

Quick Start

Ask the AI to generate a WordPress admin page that lists your plugin records using a WP_List_Table subclass with sortable columns, search, bulk revoke/delete actions protected by check_admin_referer, and per-row nonce-protected action links.

Frequently Asked Questions about wp-admin-list-table

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add sortable columns and pagination to a custom WordPress admin list table?

You add sortable columns and pagination to a WordPress admin list table by extending WP_List_Table, overriding prepare_items to handle pagination queries, and defining get_sortable_columns to whitelist ORDER BY parameters.

How do I secure bulk actions in WP_List_Table against CSRF attacks?

Securing bulk actions in WP_List_Table requires verifying nonces using check_admin_referer with the bulk-{$plural} action hook, alongside enforcing capability checks, to prevent unauthorized record deletion or state changes in your plugin admin pages.

Why does my WordPress plugin admin page show a fatal error when extending WP_List_Table?

A fatal error occurs because the WP_List_Table class is not autoloaded by default in WordPress. You must explicitly load it using require_once on the src/wp-admin/includes/class-wp-list-table.php file before extending it in your plugin.

Can I use WP_List_Table to display custom post types and plugin logs in the admin dashboard?

Yes, you can use WP_List_Table to display custom post types, logs, audits, licenses, and subscriptions in the admin dashboard. It provides native table behavior including row actions, search, views, and Screen Options for per-page handling.

What's the best way to prevent ORDER BY injection when sorting WP_List_Table columns?

The best way to prevent ORDER BY injection in WP_List_Table is by whitelisting sortable columns in get_sortable_columns and strictly sanitizing the orderby request parameter before passing it to any database query.

How do I add nonce-protected row actions to a WordPress admin list table?

To add nonce-protected row actions to a WordPress admin list table, you override the column_default or single_column methods to generate action links, ensuring each link includes a unique nonce per row for secure processing of individual record actions.