Custom Columns on Post Administration Pages

By Steven Chang

January 31, 2011

You can now add Custom Columns to Post Administration Pages especially when you are using Custom Post Types. The snippets of code below will help you set up new columns for your post type pages in no time.

add_filter('manage_edit-_columns', 'column_columns');
function column_columns($columns) {
    $columns['column_name'] = 'Column Name';
    return $columns;

the above code will register your new Column to the current columns of your Custom Post types. Remember to change <custom post type> with the singular post type name.

add_action('manage_posts_custom_column',  'column_show_columns');
function column_show_columns($name) {
    global $post;
    switch ($name) {
        case 'column_name':
		echo 'Column Value';

The code above will show the value for each row for the selected column specified by your column name.

add_action('admin_head',  'column_admin_head');
function column_admin_head() {

<?php }

and to top it off. style it with your own CSS through the admin head hook.

Steven Chang

About the author

The roles I play: Leader, Husband, Dad, Son, Brother, Friend, Programmer, Investor, Trader, Marketer, Student, Teacher, Influencer.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Direct Your Visitors to a Clear Action at the Bottom of the Page