Latest Tech and Tips

How to Set a Minimum Word Count for Word Press Posts

0

Do you run a blog site with numerous writers? Then, you possibly have actually questioned how you can set a minimum word count for your posts in Word Press. In this short article, we will certainly show you a fragment that allows you set a minimum Word count for your Word Press posts. If a individual attempts to release a message that is as well tiny, after that it will certainly return a mistake informing them the message is not long sufficient.

Simply open your motif’s functions.php documents and also paste the adhering to code:

 feature minutesWord($ material).
{
international $post;.
$ material = $post->> post_content;.
if (str_word_count($ material) < < 100)// set this to the minimum variety of words.
wp_die( __('Error: your message is listed below the minimum word count. It demands to be longer than 100 words.') );.
}
add_action(' publish_post', 'minutesWord');

You might transform the minimum variety of words from 100 to whatever you such as. You can likewise personalize the mistake to make it practical.