Cursing is a hard habit to break and most of the time people just don't pay attention and go "Oh there's a baby in here let me shut my smurfing mouth," unfortunately... My grandparents bitch at everyone for cursing because of their four year old...then two seconds after hearing "don't curse around him," you hear "smurf, damn, etc." out of their mouths. Anyways though it's probably not that they "don't listen," they probably just don't think. Another thing is people don't think about the music and television shows they watch either, it isn't only "people" doing it around them.
The way I do with my children is to just tell them that it isn't a nice word to say and only ADULTS say those words some times, even though they shouldn't or something around those lines, it usually works.,
My SO swears a TON and I was super nervous how much he would swear around LO. Well, he moved across country a week and a half ago and he hasn't sworn in any phone calls or texts. I'm sooooo surprised.
I've noticed a lot do it for attention. For my friends kids they just say that's a bad word, don't say that, and then drop it. The more you yell at them the more they will do it because they're getting your attention.
As for other people, they suck and don't listen. Lol.