Orally delivered antibiotics can reach the caecum and colon, and induce gut dysbiosis. Here we show that the encapsulation of antibiotics in orally administered positively charged polymeric nanoparticles with a glucosylated surface enhances absorption by the proximal small intestine through specific interactions of glucose and the abundantly expressed sodium-dependent glucose transporter 1. This improves bioavailability of the antibiotics, and limits their exposure to flora in the large intestine and their accumulation in caecal and faecal contents. Compared with the standard administration of the same antibiotics, the oral administration of nanoparticle-encapsulated ampicillin, chloramphenicol or vancomycin in mice with bacterial infections in the lungs effectively eliminated the infections, decreased adverse effects on the intestinal microbiota by protecting the animals from dysbiosis-associated metabolic syndromes and from opportunistic pathogen infections, and reduced the accumulation of known antibiotic-resistance genes in commensal bacteria. Glucosylated nanocarriers may be suitable for the oral delivery of other drugs causing gut dysbiosis.