How to Get Word Count Stats in WordPress (2 Ways)

How to add word count in wordpress

Do you want to add the word count stats to your WordPress website?

Here in this article, we are going to learn how we can add word count stats to the WordPress website.

By adding the word count stat to your WordPress website, you will get the facility to track the writing goals. Word count stats help you track the writer’s goals so they can write the desired length for the article.

Now let’s get started.

Why use the word count stats in WordPress website:

Word count stats help you in many ways particularly if you are running a blog website.

If you have hired writers for writing the blog for your WordPress website then you have some strict word count goals. To meet all these requirements, it is necessary to have the word count stats on your WordPress website.

Having the word count stats can help you in several ways:

You can track the writing goals towards specific goals and such as the desired length of the article.

It also indicates that the topic is covered in depth quality of the content being written, as longer articles generally indicate more in-depth coverage of a topic.

From the SEO point of view, word count plays an important role in the ranking factor of the blog. Search engine such as google gives more priority to the quality of the content and its in-depth coverage.

In conclusion, adding word count statistics to a WordPress website can provide valuable insights and help authors in various ways.

Now let’s see how we can add the word count stats to the WordPress website.

How to add the word count stats in the WordPress website:

Adding the word counts to the WordPress website is very easy. You can add the word count stats to the WordPress website using the two methods.

The first one is by using the WordPress plugin and the second method is by using the custom code for your WordPress website.

Adding the Word Count using the plugin:

For adding the word count to your WordPress website follow these simple steps:

1. First log in to your WordPress website using the user id and password.

Admin-panel

2. After login into your WordPress dashboard, now hover over the “Plugins” section and then click on the “Add New” button to add the plugin.

wordpress-admin-panel

3. Now search for the “word count analysis” plugin in the search box and then click on the “Install Now” button.

wordpress-panel

4. After installing the plugin click on the “Activate” button to activate the plugin to your WordPress website.

word-count

5. After activating the plugin it will start appearing in the WordPress dashboard. Now choose the language English and click on the “Count and Analyse words” button to get the word count of each post.

word-count-for-wordpress

Now it will start showing the word count for every post on your website. It gives you a short analysis of the post such as the word count, total characters, and total paragraph.

word-count-in-wordpress

This is how can track the word count on the WordPress website and helps you in reaching your writing goals.

Now let’s see the second method by which we can also track the word count.

Adding the word count using the custom code:

Another to add the word count to the WordPress website is by using the custom code.

This method is for experts who have good knowledge of PHP programming as WordPress mostly works in the PHP programming language.

You can also hire a WordPress developer who can do this work for you without any technical issues.

You can also add word count statistics to your WordPress website by adding a code snippet to your theme’s functions.php file.

Use the code given below:

// Add the custom column to the post list table

function custom_word_count_column_head($defaults) {

    $defaults[‘word_count’] = ‘Word Count;

    return $defaults;

}

add_filter(‘manage_posts_columns’, ‘custom_word_count_column_head’);

add_filter(‘manage_pages_columns’, ‘custom_word_count_column_head’);

// Display the word count in the custom column

function custom_word_count_column_content($column_name, $post_ID) {

    if ($column_name == ‘word_count’) {

        $content = get_post($post_ID)->post_content;

        echo str_word_count(strip_tags($content));

    }

}

add_action(‘manage_posts_custom_column’, ‘custom_word_count_column_content’, 10, 2);

add_action(‘manage_pages_custom_column’, ‘custom_word_count_column_content’, 10, 2);

Paste this code in the wp-content/themes/your-theme/functions.php paste the code to this location of your theme.

And then save the code and refresh your website and now you will get the word count in front of your posts.

word-count

This is how you can add the word count using the custom code to your WordPress website.

These two are the easiest method by which you can add the word count to your WordPress website. Hope this article solves your problem and helps you reach your writing goals for your blog.

You can also like to customize your WordPress admin panel for this you can read this blog: How to Customize WordPress Admin Dashboard

Conclusion

In conclusion, adding the word count to a WordPress website can be achieved by using a plugin or by adding code to the theme’s functions.php file.

With a few lines of code, you can display the word count for each post or page in the WordPress admin panel, making it easier for content creators to manage their writing and keep track of their progress.

This feature can be particularly useful for writers, editors, and bloggers who want to monitor the length and content of their articles.

Whether you’re working on a personal blog or a professional website, adding the word count to your WordPress site is a simple way to improve your content creation process.

Scroll to Top