How to Set Minimum Word Count on Multi-author WordPress Blog’s Post

With this tutorial, we are going to guide you to set minimum word count for your WordPress posts. If any users tries to publish a post that is smaller than the defined word count, then it will return an error message telling them the post is not long enough.

Why set minimum Word count for your WordPress posts?

Since Google has updated its search algorithm, it’s very important for writers to focus on quality content while writing and publishing blog posts. You should not post an article with a few words and some high ranked keywords in the title. An ideal post should contain at least 300 words in order to rank well in the search engines and are of great importance for your SEO strategy.

If you’re a webmaster running a multi-author website, then it’s more important for you to maintain your blog’s content quality. However, a website using WordPress framework has no inbuilt feature to control the word count. If you wish to set the minimum word limit for a blog post, then it has to be done manually.

How to Set Minimum Word Count for WordPress Posts?

To set the minimum word count on multi-author WordPress blog’s post, you need to simply open your theme’s functions.php file and paste the following code.

function minWord($content)
 
 {
 
 global $post;
 
 $content = $post->post_content;
 
 if (str_word_count($content) <300 ) //set this to the minimum number of words
 
 wp_die( __('Error: The current post is below the minimum number of words. It should be longer than 300 words.') );
 
 }
 
 add_action('publish_post', 'minWord');

The above mentioned code will set the minimum word count at 300 words for a blog post. You can change the minimum word count by changing the number in the 5th line of above code.

Consider reading Yoast SEO Plugin installation guide for better performance in 2018.

We believe, this article has helped you to set minimum word count for WordPress posts. If you liked this article, then please share this over your social media. Your shares will help us to reach more users like you.

SEE ALSO: How to Reset WordPress Admin Password Manually

LEAVE A REPLY

Please enter your comment!
Please enter your name here