Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
25 Million+
Websites using our plugins
Years of WordPress experience
WordPress tutorials
by experts

How to Set a Minimum Word Count for WordPress Posts

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Do you want to set a word count for your WordPress blog posts?

If you have multiple authors on your site, then setting up a minimum word count can help ensure that writers meet content standards and fully answer the reader’s questions.

In this article, we’ll show you how to set a minimum word count for your WordPress posts.

Set Minimum Word Count for WordPress Posts

Why Set a Minimum Word Count for Your Blog Posts?

Whether you’re creating content yourself or running a multi-author website, you should set certain content standards to ensure top-quality articles.

One of the standards you can introduce is a minimum word count for each WordPress blog post. With WordPress, you can restrict authors from publishing blog posts with thin content and ensure high content quality.

Why would you want to enforce longer posts?

Some research suggests that longer content tends to rank significantly better in search results than short content, which could help you get more traffic to your blog.

That being said, let’s look at how you can set a minimum word count in a WordPress blog. You can use the quick links below to jump right to the method that you want to use.

Method 1: Set a Minimum Word Count Using a Plugin

A simple way to add a minimum word count to your WordPress website is by using a plugin like PublishPress Checklists.

PublishPress Checklists allow you to add a blog post checklist to the WordPress editor. You can set specific tasks that authors must complete before publishing content, including adding a minimum and maximum word count on posts and pages.

Note: For this tutorial, you can use the free version of PublishPress Checklists, since it has the features we need. There’s also a premium version available that offers more features like checklists for WooCommerce products.

First, you’ll need to install and activate the PublishPress Checklists plugin. You can follow our step-by-step tutorial on how to install a WordPress plugin for more details.

Upon activation, you’ll need to go to Checklists from your WordPress admin panel. Next, you can set minimum and maximum words for the ‘Number of words in content’ option.

Change PublishPress Checklists settings

After that, you can choose whether you want to make the ‘Number of words in content’ option to be disabled, required, or recommended task from the dropdown menu.

If you select Recommended, then authors can publish articles even if they don’t meet the minimum word count. However, the Required option makes it mandatory to complete the word count task, so go ahead and select the Required option.

Besides that, PublishPress Checklists also lets you add user roles to exclude from meeting the word count requirement. Simply click on the box under the ‘Who can ignore the task’ column and select a user role.

Choose user roles to exclude

When you’ve set the number of words writers should complete, simply scroll down and click the ‘Save Changes’ button.

Save your changes

Now you can go to Posts » Add New to create a new blog post and see the minimum word count requirement in action.

If the post doesn’t contain the minimum number of words, a warning icon will appear on the ‘Publish’ button in the WordPress editor. The plugin will also show that the word count task wasn’t met in the ‘Checklist’ settings box on your right.

Minimum word count warning in editor

Once your content meets the minimum word count, the checklist task will show a green checkmark, and authors can publish the blog post.

Green checkmark when the checklist task is met

To learn more about PublishPress, you can check out our detailed PublishPress review.

Method 2: Manually Set a Minimum Word Count Limit

Another way to add a minimum word count on your WordPress website is by adding a code snippet to the functions.php files in a WordPress theme.

However, we don’t recommend editing your site’s theme files. That’s because even a small mistake can break your website and even prevent you from accessing the WordPress dashboard.

An easier way to add code to your site is by using WPCode. It lets you add custom code without worrying about breaking your site. Plus, it makes it easier to keep track of any snippets you add to your site.

First, you’ll need to install and activate the free WPCode plugin. If you need help, then check out our guide on how to install a WordPress plugin.

Note: The free version of WPCode has everything you need to add custom code in WordPress. You can upgrade to the premium version of WPCode to get advanced features like conversion pixels, code revisions, and more.

Once the plugin is active, simply head over to Code Snippets » + Add Snippet from your WordPress dashboard.

From here, go to the ‘Add Your Custom Code (New Snippet)’ option and click the ‘Use snippet’ button underneath it.

Add a new custom code snippet in WPCode

Next, you’ll need to copy the following code:

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

You may change the minimum number of words from 100 to whatever you like and also customize the error to make it helpful. Make sure to change the number in both places in the code snippets.

On the ‘Create Custom Snippet’ page, you can start by adding a title for your custom code. Next, simply paste the copied code into your new snippet under the ‘Code Preview’ area.

Be sure to choose ‘PHP Snippet’ from the dropdown list on the right as well.

Add custom code for minimum word count with WPCode

After that, scroll down to the ‘Insertion’ section. Here, you can leave the ‘Auto Insert’ option selected. This will automatically insert and execute the code for you.

Pick the insertion method for your custom code snippet

Finally, toggle the switch from ‘Inactive’ to ‘Active’ and click the ‘Save Snippet’ button.

Save and activate your custom code snippet

That’s it!

Now, if you try to publish a blog post that’s below the word count limit (100 words in our example), then you’ll see a publishing error.

Publishing error for not meeting word count

We hope this article helped you learn how to set a minimum word count for a WordPress blog. You may also want to look at how to create an email newsletter the right way, or see our expert pick of the best payroll software for small business.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

16 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Dennis Muthomi says

    I noticed there are red and orange buttons next to the Publish button in some of the screenshots. What do they mean and what do they do on the website?

  3. Dayo Olobayo says

    Fantastic article! The AIOSEO plugin lets me know if my article is below 300 words, which looks good for me. I like the wpcode method above as well but I will not be implementing as I’m the only author on my website.

    Please do you mind showing me how I can set minimum word or character limit for visitors who comments on my articles?

  4. Jiří Vaněk says

    Thanks for the snippet. The Yoast SEO plugin taught me not to create articles shorter than 300 words. Such a warning, visible at first glance, really comes in handy.

    • WPBeginner Support says

      Those are from our SEO plugin All in One SEO one is the headline analyzer while the other is the general SEO of the article :)


Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.