Title: list_table_primary_column
Published: August 18, 2015
Last modified: April 28, 2025

---

# apply_filters( ‘list_table_primary_column’, string $default, string $context )

## In this article

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

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

Filters the name of the primary column for the current list table.

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

 `$default`string

Column name default for the specific list table, e.g. `'name'`.

`$context`string

Screen ID for specific list table, e.g. `'plugins'`.

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

    ```php
    $column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
    ```

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

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

| Used by | Description | 
| [WP_List_Table::get_primary_column_name()](https://developer.wordpress.org/reference/classes/wp_list_table/get_primary_column_name/)`wp-admin/includes/class-wp-list-table.php` |

Gets the name of the primary column.

  |

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

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

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

 1.   [Skip to note 3 content](https://developer.wordpress.org/reference/hooks/list_table_primary_column/?output_format=md#comment-content-2559)
 2.    [Andrija Naglic](https://profiles.wordpress.org/andrija/)  [  8 years ago  ](https://developer.wordpress.org/reference/hooks/list_table_primary_column/#comment-2559)
 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%2Flist_table_primary_column%2F%23comment-2559)
     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%2Flist_table_primary_column%2F%23comment-2559)
 4.  A simple example for Users table and CPT table
 5.      ```php
         function my_list_table_primary_column( $default, $screen ) {//                                                             Alter the primary column in edit.php table(s)
     
         	// if we want the 'Name' column to be the primary column, on Users screen
             if ( 'users' === $screen ) {
                 $default = 'name';
             }
     
         	// if we want to set the primary column for CPT
             if ( 'edit-my_custom_post_type' === $screen ) {
                 $default = 'my_custom_column_name';
             }
     
             return $default;
         }
         add_filter( 'list_table_primary_column', 'my_list_table_primary_column', 10, 2 );
         ```
     
 6.  For further management of columns, check:
 7.  [https://developer.wordpress.org/reference/hooks/manage_post_type_posts_columns/](https://developer.wordpress.org/reference/hooks/manage_post_type_posts_columns/)
     
     To add/remove/rename columns
 8.  [https://developer.wordpress.org/reference/hooks/manage_post-post_type_posts_custom_column/](https://developer.wordpress.org/reference/hooks/manage_post-post_type_posts_custom_column/)
     
     To set the custom column values
 9.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Flist_table_primary_column%2F%3Freplytocom%3D2559%23feedback-editor-2559)
 10.  [Skip to note 4 content](https://developer.wordpress.org/reference/hooks/list_table_primary_column/?output_format=md#comment-content-6227)
 11.   [Ramon Ahnert](https://profiles.wordpress.org/rahmohn/)  [  3 years ago  ](https://developer.wordpress.org/reference/hooks/list_table_primary_column/#comment-6227)
 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%2Flist_table_primary_column%2F%23comment-6227)
     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%2Flist_table_primary_column%2F%23comment-6227)
 13. If you’re adding a column in the **first position**, it’s important to set this
     column as primary because WordPress has CSS rules that are applied for columns
     after the primary column. Otherwise, the list table can render with some layout
     issues.
 14. Example of CSS rule used by WordPress:
 15. `.wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-primary~td:not(.
     check-column)`
 16.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Flist_table_primary_column%2F%3Freplytocom%3D6227%23feedback-editor-6227)

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