Patients with prostatitis may have yellow sperm because patients with prostatitis may have elevated white blood cell counts, which can cause pus cells in the semen, resulting in yellow semen. It can also be accompanied by painful ejaculation and an abnormal odor. You need to have a semen lab test to clarify if there is a septic infection. However, patients with prostatitis who have not ejaculated for a long time may also experience yellowish semen color, which is a physiological change and not a disease phenomenon. In this case, the semen color can gradually change to milky white after several ejaculations. Therefore, it is recommended that patients should go to the hospital for relevant laboratory tests to determine whether there are abnormalities in semen quality and how to proceed with treatment.