Compounds based on alkyl polyglycosides for use in the treatment of Streptococcus agalactiae infections and other pathogens are provided. Such compounds may belong to the class of alkyl glucosides or alkyl polyglucosides. Additional active ingredients may be used which may include middle-chain saturated fatty acids or the glycerol ester derivatives thereof. Representative middle-chain saturated fatty acids or the glycerol ester derivatives thereof include: lauric acid, capric acid, caprylic acid and caproic acid and the glycerol ester derivatives thereof. Formulations which include these compounds and methods of using such compositions and formulations in the treatment and/or prevention of bacterial infections of the vaginal tract are also provided.