If you ever need to limit the amount of words in your WordPress posts, include this function in your theme’s functions.php file:

function maxWord($content){ 
global $post; 
$num = 1000; //set this to the maximum number of words 
$content = $post->post_content; 
if (str_word_count($content) > $num) 
 wp_die( __('Error: your post has reached the maximum word count of ' . $num . '.') ); 
add_action('publish_post', 'maxWord'); 

Handy for those times when your design is limited to a certain height/width or you want to impose strict guidelines in your content publishing strategy.


A number of people have asked what the maximum word count is for WordPress pages and posts.

The only restriction I’m aware of is the memory allocation in MySQL per database record. There are a number of similar reports due to page length.

Have you thought about breaking your content up into manageable chunks or sub-pages for improved usability? Long posts/pages can affect your Google ranking and performance on some lower spec browsers (mobile for example).

If it’s part of a long thesis for example, think about using chapters or “part” numbers (eg. my-long-post-part-1 and my-long-post-part-2 or my-long-post-introduction and my-long-post-my-section).