I actually did something similar with my 18 month old (who is now 18). My mother ground up bitter gourd (which is edible by the way) and I slathered it on my nipples to get DS2 to stop breastfeeding. .

He didn't like the taste at all, because it was bitter, and he quit breastfeeding. It was aversion therapy that, to me at the time, seemed less cruel than just saying 'no, you can't have it because I say so'. He just went from liking the breast to not liking it anymore and willingly gave it up.