Add Custom Column in Admin Post List in WordPress

Overview

The default Posts list shows title, author, categories, and date. Plugins and themes often need extra columns—for SKU, status flags, or SEO scores.

WordPress provides filter and action hooks without editing core.

Implementation

Add the column with manage_{$post_type}_posts_columns. Populate cells in manage_{$post_type}_posts_custom_column. For post meta, call get_post_meta($post_id, 'key', true).

Make columns sortable by mapping the column slug to a meta key in manage_edit-post_sortable_columns and adjusting pre_get_posts.

When implementing guidance from Add Custom Column in Admin Post List in WordPress, start in a controlled environment that mirrors production versions of operating systems, runtimes, and network policies. Capture a baseline before changes: export configs, snapshot VMs, or tag releases in source control so rollback stays straightforward if behavior regresses.

Document prerequisites, expected outcomes, and verification steps in a short runbook. Automated checks—smoke tests, health endpoints, or query validations—catch regressions early when platforms receive patches. Security belongs in every workflow: apply least privilege, rotate secrets, and review audit logs after deployment.

If results differ across machines, compare environment variables, permission models, time zones, and regional settings. Intermittent issues often trace to caching layers, stale DNS, or duplicated services bound to the same port.

Example

add_filter('manage_post_posts_columns', fn($c) => $c + ['sku' => 'SKU']);
add_action('manage_post_posts_custom_column', function($col, $id) {
  if ($col === 'sku') echo esc_html(get_post_meta($id, 'sku', true));
}, 10, 2);

Tips

  • Keep columns narrow; long HTML breaks layout.
  • Escape output with esc_html.
  • Remove columns users do not need via unset.
  • Test with Screen Options hidden columns.
  • Re-verify after reboots, certificate renewals, or failover exercises.
  • Align monitoring and alerts with the failure modes described in this guide.
  • Keep vendor documentation links handy for breaking changes between versions.
  • Pair automation with a manual spot check during initial production rollout.