Show message when Title field empty on WordPress editor page

If you not entered title name of post then show message for enter post title name. And if empty title filed then Publish button not work for publish post.

How to Do

Paste given code on functions.php the  SAVE.

function title_name_validation() {
?>
<script>
jQuery(document).ready(function() {
jQuery('#publish').click(function() {
if(jQuery('#title').val().length === 0) {
alert('Enter a title first');
return false;
}
});
});
</script>
<?php
}
add_action('admin_head', 'title_name_validation');

Hope this code works perfectly. Thanks for visiting.

FAQ

When publish button works?
If title field is empty then publish button not work and show alert box’s message. or If you have entered title name then publish button work fine.