Fermented feed is needed to maintain the vitality of probiotics and cannot be sterilized. Fermented feeds, especially those with added CaCO3, have a high risk of contamination with pathogens. Escherichia coli, Staphylococcus aureus, and Shigella flexneri are the main pathogenic bacteria threatening animal breeding. This study developed a new microbial quantitative real-time PCR analysis method to investigate the antibacterial rule in fermented feed with different amounts of CaCO3. Moreover, using the qPCR method, we found that the feed pH decreased slowly with the increase of CaCO3 addition. In the early stage of fermentation, CaCO3 addition promoted three pathogenic bacteria growth. In the middle and late fermentation, CaCO3 addition inhibited the growth of Escherichia coli and Shigella flexneri, and the greater the CaCO3 addition, the stronger the inhibitory effect. The CaCO3 addition reduced the growth inhibition of Staphylococcus aureus, and the inhibition effect was weaker with the increase of CaCO3 addition. From the inhibitory effect on intestinal pathogenic bacteria such as Escherichia coli and Shigella flexneri, the optimal addition amount of CaCO3 was 12%. At this level of addition, the number of Lactiplantibacillus plantarum subsp. plantarum, Lacticaseibacillus rhamnosus, and Bacillus subtilis were also the highest, and the content of organic acids with antibacterial effects was also the highest. The addition of CaCO3 had an inhibitory effect on the growth of pathogenic bacteria, mainly attributed to the promotion of the growth of Lactiplantibacillus plantarum subsp. plantarum and Lacticaseibacillus rhamnosus, and the organic acid of its fermentation product had an inhibitory effect on pathogenic bacteria. This study provides theoretical guidance for the antibacterial rule of high-pH fermented feed with different amounts of CaCO3.