Title: WP_List_Table::get_column_count
Published: April 25, 2014
Last modified: April 28, 2025

---

# WP_List_Table::get_column_count(): int

## In this article

 * [Return](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_count/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_count/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_count/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_count/?output_format=md#changelog)

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

Returns the number of visible columns.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_count/?output_format=md#return)󠁿

 int

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

    ```php
    public function get_column_count() {
    	list ( $columns, $hidden ) = $this->get_column_info();
    	$hidden                    = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
    	return count( $columns ) - count( $hidden );
    }
    ```

[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#L1386)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-admin/includes/class-wp-list-table.php#L1386-L1390)

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

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

Gets a list of all, hidden, and sortable columns, with filter applied.

  |

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

Generates the tbody element for the list table.

  | 
| [wp_plugin_update_row()](https://developer.wordpress.org/reference/functions/wp_plugin_update_row/)`wp-admin/includes/update.php` |

Displays update information for a plugin.

  | 
| [wp_theme_update_row()](https://developer.wordpress.org/reference/functions/wp_theme_update_row/)`wp-admin/includes/update.php` |

Displays update information for a theme.

  | 
| [wp_comment_reply()](https://developer.wordpress.org/reference/functions/wp_comment_reply/)`wp-admin/includes/template.php` |

Outputs the in-line comment reply-to form in the Comments list table.

  |

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

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

## User Contributed Notes

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