Thursday, November 21, 2024
HomeWordPress TutorialsHow to Get Word Count Stats in WordPress (3 Ways)

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


Do you want to get word count stats in WordPress?

When writing a post, you may have a specific word count that you’re aiming to reach. Plus, monitoring your word count stats can give you insights like what post length gets the most traffic and engagement.

In this article, we will show you how you can show detailed word count stats in WordPress.

Why Get Word Count Stats for Your WordPress Website?

There are many reasons why you may want to get the word count for your WordPress website.

If you’re a freelance writer, then you may charge per word or your clients might have strict word count goals that you need to meet.

If you’ve added multiple authors to your WordPress blog, then monitoring their word count stats can help you identify the authors who are contributing the most to your website.

This insight can help you manage your multi-author WordPress blog more efficiently. For example, you might reward the author who has the highest word count, or schedule meetings with any writers who are underperforming.

Even if you’re the only person working on a website, word count stats can still be interesting. By looking at how your word count changes over time, you may be able to spot patterns and ways to be more productive.

With all that in mind, let’s look at a few different ways to get word count stats in WordPress. If you prefer to jump straight to a particular method, then you can use the links below.

Method 1. How to Check the Word Count on an Article in WordPress

The WordPress block editor makes it easy to see the word count for any page or post.

Simply click on the ‘i’ icon at the top of the screen, and WordPress will show some basic stats for the page or post, including the word count.

Getting the word count in the WordPress block editor

Even better, this word count will update automatically as you write.

If you have a word limit, then this is a quick and easy way to make sure you don’t go over that limit.

Method 2. Get Detailed Word Count Stats in WordPress With a Plugin

Sometimes you may want to see word count stats for a particular author, type of post, or even your entire website.

The easiest way to get these detailed stats is by using the WP Word Count plugin. This plugin shows how many words you’ve written based on month, author, and post type.

If you’re using custom post types, then WP Word Count can also show statistics for your custom posts.

First, you’ll need to install and activate the plugin. If you need help, then please see our guide on how to install a WordPress plugin.

Once you’ve done that, go to Word Count » Statistics. Before you can get your stats, you’ll need to click on the ‘calculate’ link.

Calculating the word count for your WordPress website

WP Word Count will ask whether you want to count the words for all your content, or to only count content that was created within a certain date range.

To calculate the total word count for your entire site, click on the ‘Count all content on this site at one time’ option. Then, go ahead and click on Calculate Word Counts.

Getting word count stats in WordPress

After a few moments, you should see a ‘Word counts calculated successfully’ message.

WP Word Count will now continue to calculate your stats automatically as you add more posts and pages to your site. This means you won’t need to click on the ‘calculate’ link every time you want to see the latest word count stats.

Now, anytime you want to see your stats, you can go to Word Count » Statistics. To see the total word count for all your content, click on the All Content tab.

On this screen, you’ll see the total word count for the different post types, divided into published and unpublished content.

Word count statistics in the WordPress dashboard

‘Total Words’ is your total word count across all content types.

This number combines both your published and unpublished content, so it isn’t necessarily the amount of words that visitors will see live on your website.

The WP Word Count plugin

This screen also shows separate word counts for published and unpublished content.

If you want to see the word count for specific months, then simply click on the ‘Monthly Statistics’ tab. This can help you spot trends including your most productive months, and times when you wrote fewer words compared to other months.

Monthly word count stats in WordPress

If multiple people write for your WordPress blog, then you may want to take a look at the ‘Author Statistics’ tab.

This lets you explore your site’s word count stats by author.

Author word count statistics in WordPress

You might also want to track the traffic that each of your authors brings to your website. To do that, you can see our guide on how to set up author tracking in WordPress.

By monitoring these important metrics on your WordPress site, you can identify what’s working on your website and what isn’t.

You can then use this insight to fine-tune your content calendar to get even more visitors to your website, and make money online blogging with WordPress.

Method 3. How to Add Word Count Stats in WordPress Using Code

Another option for tracking word counts is a code solution. This code snippet will show the word count next to each post on the Posts » All Posts screen.

Adding a word count to the WordPress dashboard

This is an easy way to spot your site’s longest posts, or check for any posts that don’t meet a required word count.

To show a word count on the All Posts screen, you’ll need to add some code to your site. We recommend doing this by creating a site-specific plugin or using a code snippets plugin.

No matter what option you choose, you’ll need to add the following code:

add_filter('manage_posts_columns', 'wpbeginner_add_column');
function wpbeginner_add_column($wpbeginner_wordcount_column) {
    $wpbeginner_wordcount_column['wpbeginner_wordcount'] = 'Word Count';
    return $wpbeginner_wordcount_column;
}
 
//Link the word count to our new column//
add_action('manage_posts_custom_column',  'wpbeginner_display_wordcount'); 
function wpbeginner_display_wordcount($name) 
{
   global $post;
   switch ($name)
{
     case 'wpbeginner_wordcount':
		//Get the post ID and pass it into the get_wordcount function//
            $wpbeginner_wordcount = wpbeginner_get_wordcount($post->ID);
            echo $wpbeginner_wordcount;
     }
}

function wpbeginner_get_wordcount($post_id) {
     //Get the post, remove any unnecessary tags and then perform the word count// 
     $wpbeginner_wordcount = str_word_count( strip_tags( strip_shortcodes(get_post_field( 'post_content', $post_id )) ) );
      return $wpbeginner_wordcount;

You can then save your changes.

Now, if you visit the Posts » All Posts screen, you’ll see the word count in a new column.

We hope this guide helped you learn how to get word count stats in WordPress. You may also want to learn how to set up Google Analytics goals for your WordPress site, or check out our list of the best email marketing services for small businesses.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Get Word Count Stats in WordPress (3 Ways) first appeared on WPBeginner.





Source link

RELATED ARTICLES
Continue to the category

LEAVE A REPLY

Please enter your comment!
Please enter your name here


Most Popular

Recent Comments