Dietary fiber has a potential to modulate the gut microbiota in sows. We hypothesized that a maternal diet rich in either high- or low-fermentable fiber during gestation and lactation influences Clostridioides difficile gut colonization in suckling piglets. Twenty sows were fed gestation and lactation diets enriched with either high-fermentable sugar beet pulp (SBP) or low-fermentable lignocellulose (LNC) fibers. C. difficile, toxin B (TcdB), fecal score, microbial abundance (16S-rDNA sequencing) and metabolites were measured in the feces from the sows and their piglets. C. difficile concentration was higher in piglets from the sows fed LNC than SBP along the study (P ≤ 0.05). Higher prevalence of C. difficile was noted in three-week-old piglets from sows fed LNC vs. SBP (45% vs. 0%, P = 0.001). TcdB prevalence was higher in six-day-old piglets from the sows fed LNC vs. SBP (60% vs. 17%, P = 0.009). In sows, fecal microbial metabolites were higher in SBP than LNC, while C. difficile concentration showed no difference. Higher microbial diversity Shannon index was noted in sows from SBP vs. LNC one week before parturition and at the parturition (P ≤ 0.05). Piglets from SBP vs. LNC tended to have higher microbial diversity Shannon index at two and three weeks of age. Diets enriched with high-fermentable fiber compared to low-fermentable fiber in sows reduced C. difficile colonization in their piglets. Susceptibility to colonization by C. difficile in neonatal piglets can be modulated by the sows’ diet, supporting the hypothesis of the early microbial programming in the offspring and the importance of the sow-piglet couple.