Display post word count on the Dashboard

I found this handy snippet that can be used to display the word count of your posts within the WordPress Dashboard. The best way, or more so the easiest way to add this is with the Code Snippets plugin, else you could add it to your theme’s function file.

<?php

//-----
// Post Word Count Checker - Keep Commented Unless Using
//-----

// Add Length Column
add_filter('manage_post_posts_columns', function ( $columns )
{
    $_columns = [];

    foreach( (array) $columns as $key => $label )
    {
        $_columns[$key] = $label;
        if( 'title' === $key )
            $_columns['ryu_post_content_length'] = __( 'Length' );  
    }
    return $_columns;
} );
// Fill Column With Word Counts
add_action( 'manage_post_posts_custom_column', function ( $column_name, $post_id )
{
    if ( $column_name == 'ryu_post_content_length')
        echo str_word_count( strip_tags( get_post( $post_id )->post_content ) );

}, 10, 2 );
// Make Column Orderable
add_filter( 'manage_edit-post_sortable_columns', function ( $columns )
{
  $columns['ryu_post_content_length'] = 'ryu_post_content_length';
  return $columns;
} );
// Order Through Proper Filter
add_filter( 'posts_orderby', function( $orderby, \WP_Query $q )
{
    $_orderby = $q->get( 'orderby' );
    $_order   = $q->get( 'order' );

    if(
           is_admin()
        && $q->is_main_query()
        && 'ryu_post_content_length' === $_orderby
        && in_array( strtolower( $_order ), [ 'asc', 'desc' ] )
    ) {
        global $wpdb;
        $orderby = " LENGTH( {$wpdb->posts}.post_content ) " . $_order . " ";
    }
    return $orderby;
}, 10, 2 );
?>