Create banned words list for WP titles
Why do you need a banned word list for titles?
Running a blog with multiple authors is such a nightmare. You got to deal with many things and on the top of the all you also got to look for the content being posted on the blogs.
You can either reduce the access level of bloggers and read all the content first by yourself and then publish it but it would take like forever and it would only add another task to your responsibilities. Then there is this way, in which you can add words you want to ban on the website and WordPress simply won’t let the bloggers add the titles with the banned words itself. Problem Solved.
How Do I Access Functions.php?
You’ll have to add this tiny function and a hook in your functions.php file which is stored in your theme’s directory.
CAUTION: BACKUP YOUR WEBSITE BEFORE DOING ATTEMPTING CHANGES. I WONT BE RESPONSIBLE FOR ANY MISHAP.
Code[php] function wpb_title_bws($sTitle)
$BannedWords = "abc,xyz,omg"; // Banned words seperated by comma.
$BannedWords = explode(",", $BannedWords);
$sTitle = $post->post_title;
foreach($BannedWords as $BannedWord)
if (stristr($sTitle, $BannedWord))
wp_die( __(‘Error: Remove the banned word "’. $BannedWord .’" in post title first!’) );
add_action(‘publish_post’, ‘wpb_title_bws’, 10, 1);