Filter items before inserting into database.