I had a pair of sandels that made that noise. I put in a thin panty liner in the bottom, and it worked just fine.
I am not so sure that WD40 would be a good thing to use on shoes as it is meant for lubricating and loosening joints and hinges, removing dirt and residue, extricating stuck screws and bolts, and preventing rust. Also, it could discolor the shoes.
It's going to depend on where the farting ;-) is coming from. There are some really good solutions at this link:
http://www.essortment.com/lifestyle/homerepairssqu_sadz.htm
Also, if the noise is coming from the type of soles like tennis shoes have and it only happens when they get wet and you then walk on certain surfaces then try roughing up the bottom of the soles with sand paper or a cheese grater.
Add your voice to the conversation. Click here to answer this question.