Title: manage_pages_custom_column
Published: April 25, 2014
Last modified: August 20, 2026

---

# do_action( ‘manage_pages_custom_column’, string $column_name, int $post_id )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#parameters)
 * [More Information](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#wp--skip-link--target)

Fires in each custom column on the Posts list table.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#description)󠁿

This hook only fires if the current post type is hierarchical, such as pages.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#parameters)󠁿

 `$column_name`string

The name of the column to display.

`$post_id`int

The current post ID.

## 󠀁[More Information](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#more-information)󠁿

Combined with the [manage_pages_columns](https://developer.wordpress.org/reference/hooks/manage_pages_columns/)
filter, this allows you to add or remove (unset) custom columns to the list page
pages. Note that if you are using custom post types and it has ‘`hierarchical`‘ 
=> `true`, then you will need to use this action hook and not [manage_$post_type_posts_custom_column](https://developer.wordpress.org/reference/hooks/manage_post-post_type_posts_custom_column/).

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#source)󠁿

    ```php
    do_action( 'manage_pages_custom_column', $column_name, $post->ID );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-posts-list-table.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-admin/includes/class-wp-posts-list-table.php#L1476)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/class-wp-posts-list-table.php#L1476-L1476)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_Posts_List_Table::column_default()](https://developer.wordpress.org/reference/classes/wp_posts_list_table/column_default/)`wp-admin/includes/class-wp-posts-list-table.php` |

Handles the default column output.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 3 content](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#comment-content-2905)
 2.    [Khoi Pro](https://profiles.wordpress.org/khoipro/)  [  8 years ago  ](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/#comment-2905)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fmanage_pages_custom_column%2F%23comment-2905)
     Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fmanage_pages_custom_column%2F%23comment-2905)
 4.  **To add “Template” column into page list:**
 5.      ```php
         add_filter( 'manage_pages_columns', 'page_column_views' );
         add_action( 'manage_pages_custom_column', 'page_custom_column_views', 5, 2 );
         function page_column_views( $defaults )
         {
         	$defaults['page-layout'] = __('Template', 'textdomain');
         	return $defaults;
         }
         function page_custom_column_views( $column_name, $id )
         {
         	if ( $column_name === 'page-layout' ) {
         		$set_template = get_post_meta( get_the_ID(), '_wp_page_template', true );
         		if ( $set_template == 'default' ) {
         			echo __('Default Template', 'textdomain');
         		}
         		$templates = get_page_templates();
         		ksort( $templates );
         		foreach ( array_keys( $templates ) as $template ) :
         			if ( $set_template == $templates[$template] ) echo $template;
         		endforeach;
         	}
         }
         ```
     
 6.  **To add to other post types (not post, page or attachment…):**
 7.  The hooks to create custom columns and their associated data for a custom post
     type are `manage_{$post_type}_posts_columns` and `manage_{$post_type}_posts_custom_column`
     respectively, where `{$post_type}` is the name of the custom post type.
 8.      ```php
         // Add the custom columns to the book post type:
         add_filter( 'manage_book_posts_columns', 'set_custom_edit_book_columns' );
         function set_custom_edit_book_columns($columns) {
             unset( $columns['author'] );
             $columns['book_author'] = __( 'Author', 'textdomain' );
             $columns['publisher'] = __( 'Publisher', 'textdomain' );
     
             return $columns;
         }
     
         // Add the data to the custom columns for the book post type:
         add_action( 'manage_book_posts_custom_column' , 'custom_book_column', 10, 2 );
         function custom_book_column( $column, $post_id ) {
             switch ( $column ) {
     
                 case 'book_author' :
                     $terms = get_the_term_list( $post_id , 'book_author' , '' , ',' , '' );
                     if ( is_string( $terms ) )
                         echo $terms;
                     else
                         _e( 'Unable to get author(s)', 'textdomain' );
                     break;
     
                 case 'publisher' :
                     echo get_post_meta( $post_id , 'publisher' , true ); 
                     break;
     
             }
         }
         ```
     
 9.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fmanage_pages_custom_column%2F%3Freplytocom%3D2905%23feedback-editor-2905)
 10.  [Skip to note 4 content](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/?output_format=md#comment-content-4432)
 11.   [Steven Lin](https://profiles.wordpress.org/stevenlinx/)  [  6 years ago  ](https://developer.wordpress.org/reference/hooks/manage_pages_custom_column/#comment-4432)
 12. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fmanage_pages_custom_column%2F%23comment-4432)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fmanage_pages_custom_column%2F%23comment-4432)
 13. Example migrated from Codex:
 14. Once you have added your column (for this example, thumbnail), the featured image
     can be displayed for that page in the new thumbnail column.
 15.     ```php
         function custom_page_column_content( $column_name, $post_id ) {
         	if ( $column_name == 'thumbnail' ) {
         		$post_thumbnail_id = get_post_thumbnail_id( $post_id );
         		if ( $post_thumbnail_id ) {
         			$post_thumbnail_img = wp_get_attachment_image_src( $post_thumbnail_id, 'thumbnail' );
         			echo '<img src="' . $post_thumbnail_img[0] . '" />';
         		}
         	}
         }
     
         add_action( 'manage_pages_custom_column', 'custom_page_column_content', 10, 2 );
         ```
     
 16.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fmanage_pages_custom_column%2F%3Freplytocom%3D4432%23feedback-editor-4432)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fmanage_pages_custom_column%2F)
before being able to contribute a note or feedback.