How to set a minimum word count for multi-author WordPress blog post?


Suppose you are the owner of a multi-author WordPress blog and you want to set a minimum word count for each blog posted by your author. So bloggers won’t be able to post short blog posts.

Here is a tutorial on how to set a minimum word count for WordPress blog. Once the word count is set, an error will be displayed when a blogger tries to publish a blog shorter than the minimum word count.

Go to Dashboard > Appearance > Editor, open functions.php file and copy-paste the following code:

1
2
3
4
5
6
7
8
9
10
<?
function minWordCount($content)
{
	global $post;
	$content = $post->post_content;
	if (str_word_count($content) < 100 ) //the minimum number of words
	wp_die( __('Oops: your post is below the minimum word count. It needs to be at least 100 words or more.') );
}
add_action('publish_post', 'minWordCount');
?>

You have set the minimum word count to 100 words. You can change both the word count and the warning according to your blog standards.

Regards,
Jinnat Ul Hasan

By | On Tuesday, October 4th, 2011 | Under How To's | 1 Comment »


DO YOU NEED OUR HELP?

Contact our experts, most of the time we assist our readers free of charge.

Those who found this page were searching for:

  • wordpress minimum words
  • how to set minimum post on blogger homepage
  • how to ccount words for a blog
  • set min words wordpress
  • minimum word count for
  • word count in wordpress post
  • how to set minimum length for word count in wordpress
  • minimum word count for blog
  • where to set count words in post comment in wordpress
  • what is the minimum amount of words for a blog post
  • http://www.tajul.com/ Tajul Islam

    I can not understand your post properly.

Previous post:

Next post: