All of you have mentioned sex, but what about those who havnt had sex in a while? I had the same problem, yellow pus around the penis head where the foreskin area is, even before I had sex. Even after a year of not having sex I still get it every now and then but very mild. However I do masterbate and I feel like that is the cause of it. Not sure.
it is rare so udont worry
It's lint that is decomposing and it means you need to wash it a bit better