Set Minimum Word Count on Posts

function minWord($content){ 
 
global $post;
$num = 100; //set this to the minimum number of words
$content = $post->post_content;
 
if (str_word_count($content) <  $num) 	    wp_die( __('Error: your post is below the minimum word count.') ); } add_action('publish_post', 'minWord');
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s