The intestinal microbiota is crucial to intestinal homeostasis. Porcine epidemic diarrhea virus (PEDV) is high pathogenic to intestines, causing diarrhea, even death in piglets. To investigate the detailed relationship between PEDV infection and intestinal microbiota, the composition and distribution of intestinal microbiota from pigs were first analyzed using 16S rRNA sequencing technology. The results demonstrated that the composition and distribution of microbes in different intestinal segments were quite similar between 1-week-old and 2-week-old piglets but different from 4-week-old (weaned) piglets. Then piglets at different ages were inoculated with PEDV. The results showed that the 1-week-old piglets exhibited the most severe pathogenicity comparing to the other age groups. Further investigations indicated that Lactobacillus, Escherichia coli, and Lactococcus in the intestinal microbiota of piglets were significantly changed by PEDV infection. These results strengthen our understanding of viruses influencing intestinal microbes and remind us of the potential association between PEDV and intestinal microbes.