I also had this problem when my first son was 4 years old. Unfortunately we had a drunk for a next door neighbour, who used to swear at my kids. My son was 4, and my daughter 2 when they learnt to swear. I also tried the soap, but son just thought it was funny to bite a big chunk out of it and eat it. The more fuss I made about them swearing, the more they swore, so I just started ignoring them. If they swore, I said "don't say that, it's not a nice word/s to say," then just ignore any more words they said for the next 1/2 hour. When they don't get the reaction from you they are expecting, it's no longer fun to say the naughty words. It worked for me, so I hope it works for you too. Good luck, and let me know if it works.
Mother of 3, Qld