Steps
- Add the PHP code to your theme’s
functions.php. - Save the changes.
- Go to WordPress Dashboard → Posts → All Posts.
- A new Word Count column will appear.
- Each post will show its approximate word count.
/**
* Add Word Count column to WordPress Posts list
*/
function custom_add_word_count_column( $columns ) {
$columns['word_count'] = 'Word Count';
return $columns;
}
add_filter( 'manage_posts_columns', 'custom_add_word_count_column' );
/**
* Display word count in the custom column
*/
function custom_display_word_count_column( $column, $post_id ) {
if ( 'word_count' === $column ) {
$content = get_post_field( 'post_content', $post_id );
$word_count = str_word_count(
wp_strip_all_tags( $content )
);
echo esc_html( $word_count );
}
}
add_action(
'manage_posts_custom_column',
'custom_display_word_count_column',
10,
2
);
Tested on
WordPress 6.8
Reported by the author on October 8, 2026. WPFolks has not verified this.
Not tested against WordPress 7.1.3. It may still work.