Context. The Rosetta spacecraft made continuous measurements of the coma of comet 67P/ Churyumov-Gerasimenko (67P) for more than two years. The plasma in the coma appeared very dynamic, and many factors control its variability. Aims. We wish to identify the effects of solar flares on the comet plasma and also their effect on the measurements by the Langmuir Probe Instrument (LAP). Methods. To identify the effects of flares, we proceeded from an existing flare catalog of Earth-directed solar flares, from which a new list was created that only included Rosetta-directed flares. We also used measurements of flares at Mars when at similar longitudes as Rosetta. The flare irradiance spectral model (FISM v.1) and its Mars equivalent (FISM-M) produce an extreme-ultraviolet (EUV) irradiance (10-120 nm) of the flares at 1 min resolution. LAP data and density measurements obtained with the Mutual Impedence Probe (MIP) from the time of arrival of the flares at Rosetta were examined to determine the flare effects. Results. From the vantage point of Earth, 1504 flares directed toward Rosetta occurred during the mission. In only 24 of these, that is, 1.6%, was the increase in EUV irradiance large enough to cause an observable effect in LAP data. Twenty-four Mars-directed flares were also observed in Rosetta data. The effect of the flares was to increase the photoelectron current by typically 1-5 nA. We find little evidence that the solar flares increase the plasma density, at least not above the background variability. Conclusions. Solar flares have a small effect on the photoelectron current of the LAP instrument, and they are not significant in comparison to other factors that control the plasma density in the coma. The photoelectron current can only be used for flare detection during periods of calm plasma conditions.