Yes. Potential sperm donors are pre-screened following a series of rigorous selection criteria. In fact, less than 10% of the candidates are accepted. When a candidate is accepted, they are medically and psychologically screened previously as well. Moreover, they are tested for a number of hereditary and infectious diseases.
Using the semen of men who advertise on websites, forums, etc., can be dangerous because they are not previously screened. Thus, the risk of transmitting a STD is high.