BACK TO TOP

How to Set a Minimum Word Count for WordPress Posts

How to Set a Minimum Word Count for WordPress Posts

Whether you’re running a multi-author blog with a built-in WordPress user role system or you’re writing all your articles yourself, there are always ways in which you can put more effort and ensure the top-notch quality of your content. And setting up a minimum word count on your WordPress posts is a great way to do exactly that, and then some.

A minimum word count can:

  • help you build authority – longer posts tend to be more comprehensive and informative in general, helping you provide more value to readers and giving you the potential to establish more authority in your niche.
  • increase the chance of a higher ranking – search engines tend to rank longer articles higher up in SERPs than shorter ones, which means longer content can only contribute to your website’s visibility and help drive more traffic to your site.

And so, if you set up a minimum WordPress word count on your posts, you will push yourself (and/or your blogging staff) to work on those articles longer. By doing so, you will ensure that your content is more thorough in general and that it meets the high-quality standards needed to gain the recognition it deserves both from the readers and from the search engines.

This time around, we will show you how you can easily set a minimum word count on your WordPress site with the help of two different plugins. One will allow you to do this automatically, and you can use the other to set the minimum word count manually.

Blog & Magazine Themes
Behold banner
Behold

Personal Blog WordPress Theme

Buzzy banner
Buzzy

Creative Magazine Theme

Journo banner
Journo

Creative Magazine & Blog Theme

Setting a Minimum Word Count in WordPress With the PublishPress Checklists Plugin

The first plugin we will be using for these purposes is called PublishPress Checklists. Basically, this plugin will let you set certain tasks that you (or other authors on your blog) have to complete before your content can be published. Some of the options you can add with this plugin include the ability to set a minimum or a maximum WordPress word count, require the use of a featured image, get authors to use a certain number of categories or tags, and so on.

PublishPress Checklists

There is also a pro version of the PublishPress Checklists plugin available that comes with some additional features, such as the ability to set standards for your WooCommerce products. That being said, we will be using the free version of the plugin as it has all the features needed to set up a minimum word count on your articles.

After installing the plugin and activating it, head to the Checklists page located in your WordPress admin dashboard. Then, make sure to configure the option called “Number of words in content”.

Checklists Number of Words in Content

Here, you should click on a dropdown from which you will be able to pick three different options – Disabled, Required, or Recommended.

Number of Words

Selecting Recommended will allow you to publish articles despite not meeting the minimum word count while selecting the Required makes sure that the minimum word count you set is obligatory to be able to publish a post. Therefore, you should choose the Required option.

You can also specify user roles in case you wish to make any exceptions to the minimum word count rule. To do this, just choose the option under the text that says “Who can ignore the task” and pick a user role.

Who Can Ignore the Task

Finally, you can specify the minimum word count number under the Options column (in the Min field).

Options Min

Don’t forget to hit the Save Changes button (located at the bottom) once you’re done with configuring your options.

Save Changes

Once you’re done, you can head to Posts >> Add New to create your blog post. If your post doesn’t have the minimum number of words required, you will receive a warning message once you hit Publish.

Checklist

After you write the minimum required number of words to your post, the message will disappear and you will be able to publish your post.

Setting a Minimum Word Count in WordPress Manually Using the Code Snippets Plugin

If you know how to code and prefer to set a minimum WordPress word count on your posts manually, you can always do this by adding a code snippet to your theme’s functions.php file. However, directly altering your theme files in this way always carries a certain risk of accidentally breaking your site. To avoid this, there is a plugin called Code Snippets that will provide you with an easier and safer way to add custom code to your WordPress site and set a minimum word count on your posts with ease.

Code Snippets

After you install and activate the Code Snippets plugin, you need to access Snippets >> Add New located in your admin dashboard and insert the title for your snippet.

Add New Snippet

Then, you simply need to add this code into the Code field:

function minWord($content)
{
global $post;
$content = $post->post_content;
if (str_word_count($content) < 300)
wp_die( __('Error: your post doesn’t meet the minimum word count. It needs to be longer than 300 words.') );
}
add_action('publish_post', 'minWord');

You can change the minimum number of words from 300 to any other number you prefer and even modify the custom error message. Just be sure to edit the number in both places within the code.

Code Save Changes and Activate

Once you insert your code snippet into the Code area, you should hit the Save Changes and Activate button and you’ll be all set. Now, you will receive an error once you attempt to publish your post if it contains the number of words lower than the one you specified in your code snippet:

Publishing Error

Conclusion

Aside from helping you explore your topics in more detail and offering more value to those reading your content, longer posts tend to generally do better in search rankings. Therefore, by setting a minimum word count on your articles, you will only help ensure a better quality of your posts and increase your chances of driving more valuable traffic to your blog. If you’re looking for an easy way to set up the minimum word count on your posts while also adjusting your settings for different user roles, we recommend using the PublishPress Checklists plugin for this task. On the other hand, if you know how to code, the Code Snippets plugin may be perfect for you as it allows you to easily and safely insert a code snippet without having to modify your theme’s files. Either way, just make sure to carefully follow the instructions we provided above, and you’ll have this useful feature set up on your WordPress blog in no time.

Post your comment

Comments0