Title: Disabling profanity filter in wordpress comments
Last modified: January 5, 2017

---

# Disabling profanity filter in wordpress comments

 *  Resolved [kosmicbird](https://wordpress.org/support/users/kosmicbird/)
 * (@kosmicbird)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/disabling-profanity-filter-in-wordpress-comments/)
 * Hello,
 * I would like to disable the built-in profanity filter for the comments on my 
   site (I am using standard wordpress comments). I was able to do this a long time
   ago by modifying something in the core files, but I can’t remember how I did 
   it. Would rather not spend hours again looking through the files to figure it
   out. Could someone please shed some light on how to do it?

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Clayton James](https://wordpress.org/support/users/claytonjames/)
 * (@claytonjames)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/disabling-profanity-filter-in-wordpress-comments/#post-8620039)
 * There are comment moderation and blacklist options that can be customized by 
   adding or removing keywords from Dashboard > Settings > Discussion, but WordPress
   doesn’t have a built in profanity filter.
 * Are you sure you aren’t using a plugin for that ?
 *  Thread Starter [kosmicbird](https://wordpress.org/support/users/kosmicbird/)
 * (@kosmicbird)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/disabling-profanity-filter-in-wordpress-comments/#post-8620048)
 * I am sure I’m not using any kind of content filtering plugin, and 99% certain
   that I am using standard wordpress comments (I have jetpack plugin but I have
   their comments feature disabled) and have downloaded no other comment plugins.
 * If I can recall correctly, I think one of the WP core files contained some code
   that automatically blacklists certain words in the wordpress comments. Looks 
   like I might have to go file diving again ☹️
 *  Thread Starter [kosmicbird](https://wordpress.org/support/users/kosmicbird/)
 * (@kosmicbird)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/disabling-profanity-filter-in-wordpress-comments/#post-8620093)
 * Ah wait, I just realized the culprit might be that akismet plugin that came along
   when I installed WP. Not for sure though. Going to keep digging..
 * *edit: ok I don’t think it’s akismet, because I have it disabled and comments
   with profanity are still being routed to the trash.
    -  This reply was modified 9 years, 5 months ago by [kosmicbird](https://wordpress.org/support/users/kosmicbird/).
 *  [Clayton James](https://wordpress.org/support/users/claytonjames/)
 * (@claytonjames)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/disabling-profanity-filter-in-wordpress-comments/#post-8620111)
 * If you find where you think you’ve located it a WordPress core file, please come
   back and post the file name and code location. I would be interested in taking
   a look.
 * Just a word of caution: You should never edit a WordPress core file.
 *  Thread Starter [kosmicbird](https://wordpress.org/support/users/kosmicbird/)
 * (@kosmicbird)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/disabling-profanity-filter-in-wordpress-comments/#post-8620148)
 * Yes! Found it and fortunately only lost about an hour this time.
 * In wp-includes/comment.php there is this block of code:
 *     ```
       if (wp_blacklist_check(
              $commentdata['comment_author'],
              $commentdata['comment_author_email'],
              $commentdata['comment_author_url'],
              $commentdata['comment_content'],
              $commentdata['comment_author_IP'],
              $commentdata['comment_agent']
         ) ) {
              $approved = EMPTY_TRASH DAYS ? 'trash' : 'spam';
         }
       }
       ```
   
 * I had to remove `$commentdata['comment_content']` and now it’s not filtering 
   profanity comments into the trash anymore. However now it is routing to the moderation
   queue… so I still need to figure out how to make it auto approve.
 * Thanks for the word of caution… in many cases it is best not to edit core files,
   but for max customization it’s unavoidable. Of course I use a child theme and
   also externally backup all my mods that aren’t protected by the child theme (
   now, since I learned my lesson after the recent WP update, which is also the 
   reason why I had to go back and remodify this particular issue). I have also 
   disabled automatic updates for WP and plugins now. But for the average user… 
   those are definitely words to live by 🙂
 * *edit: I changed `$approved = EMPTY_TRASH DAYS ? 'trash' : 'spam';` to `$approved
   = EMPTY_TRASH DAYS ? 'approved' : 'approved';` and now it’s not filtering at 
   all. Problem solved!
    -  This reply was modified 9 years, 5 months ago by [kosmicbird](https://wordpress.org/support/users/kosmicbird/).
    -  This reply was modified 9 years, 5 months ago by [kosmicbird](https://wordpress.org/support/users/kosmicbird/).
    -  This reply was modified 9 years, 5 months ago by [kosmicbird](https://wordpress.org/support/users/kosmicbird/).
    -  This reply was modified 9 years, 5 months ago by [kosmicbird](https://wordpress.org/support/users/kosmicbird/).
 *  [Clayton James](https://wordpress.org/support/users/claytonjames/)
 * (@claytonjames)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/disabling-profanity-filter-in-wordpress-comments/#post-8620432)
 * > Thanks for the word of caution… in many cases it is best not to edit core files,
   > but for max customization it’s unavoidable.
 * Core files should never be modified. That’s what filters and plugins are for.
 * Glad you found something that works for you. It would be cool to discover where
   your blacklisted words are actually coming from though, rather than just circumventing
   the list by telling WordPress to publish comments with blacklisted words rather
   than sending them to moderation or the trash. Weird. Or maybe there’s something
   I’m just not thinking of. 🙂
 *  Thread Starter [kosmicbird](https://wordpress.org/support/users/kosmicbird/)
 * (@kosmicbird)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/disabling-profanity-filter-in-wordpress-comments/#post-8620459)
 * True, true. 🙂 I guess I am just a little rebellious 😉 The way I look at it,
   I’d rather just make a few changes in the core files when possible than to slow
   my site down with even more plugins (I’m already using about 20 of them!) Not
   really sure why modifying core files is an absolute no-no if it’s done carefully.
 * Yea, I think the first time I dealt with this I actually did find where the blacklisted
   words were coming from and did something to make it stop referring to that list,
   but this is the first solution I came across and for the sake of saving time 
   I’m just going to roll with it haha.
 * For anyone looking at this in the future – I would not advise this method if 
   you think you will ever want your site to filter blacklisted words to the trash
   or for moderation, because (aside from the fact that you shouldn’t modify core
   files…)it’s very easy to forget what changes were made!
    -  This reply was modified 9 years, 5 months ago by [kosmicbird](https://wordpress.org/support/users/kosmicbird/).
    -  This reply was modified 9 years, 5 months ago by [kosmicbird](https://wordpress.org/support/users/kosmicbird/).

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Disabling profanity filter in wordpress comments’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 2 participants
 * Last reply from: [kosmicbird](https://wordpress.org/support/users/kosmicbird/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/disabling-profanity-filter-in-wordpress-comments/#post-8620459)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
