$title = $post->post_title;
$restrictedWord = "forbidden";
if (stristr( $title, $restrictedWord))
wp_die( __('Error: This title is containing restricted word') );
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.