Distasteful content

What is the best way to screen text input by a user that is being stored in the database for unwanted and objectionable words?

Create a list of unwanted words, split the input into words (divide the string on spaces and punctuation), and check if each of those words is one in the list. The unwanted word list can be stored in code as an array or in a database.