It also depends on your kid's personality. For my elder son, after a serious talk and repeated reminds, he stops. For my younger son, every time he admitted it's wrong, yet he'd did it again right on the spot. After all the recommended methods on books, I finally took the strict approach and literally washed his mouth whenever he did that. Then he moved up to the 4 year class and stops all the bad words all of sudden.