Precise prevention and control measures have been adopted to impede the transmission of coronavirus disease 2019 (COVID‐19) in China. This study was performed to investigate the effect of protective measures on gastrointestinal infection in children during the COVID‐19 pandemic. The data on the rotavirus and adenovirus antigen tests were collected in outpatient children due to gastroenteritis from January 1, 2019 to December 31, 2020, at the Children's Hospital of Zhejiang University School of Medicine. According to age and month distribution, the positive number and rate of rotavirus and adenovirus in 2020 were compared with 2019. A 3.8‐fold and 4‐fold reduction in the number of rotavirus‐ and adenovirus‐positive patients in 2020 were found, respectively. The overall positive rate of rotavirus and adenovirus infection was drastically decreased in 2020 (rotavirus 2020: 18.18% vs. 2019: 9.75%,
p
< 0.001; adenovirus 2020: 3.13% vs. 2019: 1.58%,
p
< 0.001). The proportions of rotavirus and adenovirus in all age groups in 2020 decreased compared with those in 2019. The highest frequency of rotavirus infection occurred among children aged 1–3 years both in 2019 and 2020 (2019: 27.95% vs. 2020: 17.19%,
p
< 0.001), while adenovirus infection was detected in children aged 3–5 years, which had the highest percent positivity (2019: 8.19% vs. 2020: 4.46%;
p
< 0.001). An obvious peak prevalence of rotavirus incidence was found during December–April, and the percent positivity of rotavirus significantly decreased in 2020 (December 2019: 24.26% vs. 2020: 8.44%,
p
< 0.001; January 2019: 40.67% vs. 2020: 38.18%,
p
< 0.05; February 2019: 40.73% vs. 2020: 15.04%,
p
< 0.001; March 2019: 31.47% vs. 2020: 7.88%,
p
< 0.001; April 2019: 15.52% vs. 2020: 4.78%,
p
< 0.001). The positive rate of adenovirus distributed throughout 2019 was 1.91%–4.86%, while the percent positivity during 2020 in the same period was much lower (0.00%–3.58%). Our results confirmed that the preventive and control measures adopted during the COVID‐19 pandemic and the collateral benefit of these interventions have significantly decreased the transmission of rotavirus or adenovirus.