Hello friends, welcome to my another blog post how to set maximum post title length in WordPress. By default, we can put very short or very long title of our WordPress post. There is no restriction from WordPress that you can not put hung post title. But in SEO purpose, we can not set very long for our post. So if you want that your post title should be inside some character length or post title, not more than 60 characters then you are incorrect place.
Here I will show you how to set maximum post title length for your blog. Copy the below code and past it inside your theme functions.php.
$title = $post->post_title;
if (str_word_count($title) >= 60 ) //set this to the maximum number of words
wp_die( __('Error: your post title is over the maximum word count.') );
Now you know how to set maximum post title length in WordPress. Please share my post and if you want somethings more comment below.