Livestock manure treatment technology and composting and its products have been widely used in agricultural soil. However, little was known about the variations in the fate of pathogens and the factors affecting their pathogenic ability during this process, which posed threats to ecological safety and public health globally. This study used a metagenomic approach to profile the behaviors of pathogens during peroxydisulfate composting. Results showed that Pseudomonas aeruginosa, Klebsiella pneumoniae, Escherichia coli, Burkholderia pseudomallei, and Mycobacterium tuberculosis were the main secretors of virulence factors (VFs) in composting system; their abundance and the virulence factor-related genes they carried were better downregulated under the role of peroxydisulfate. In addition, peroxydisulfate composting ensured the lower moisture, weakening the swimming mobility behavior of pathogens through suppressing the abundance of genes associated with flagellar formation, and impaired the communication between pathogens by regulating quorum sensing (QS)- and quorum quenching (QQ)-related genes. Moreover, reduced abundance of resistomes restricted pathogens disseminating infection. In summary, this study provided useful strategies in managing pathogen pathogenic ability during composting based on pathogenic source (pathogens), pathway (VFs), influencing factors (QS/QQ, physicochemical habitats), and resistomes.© 2024. The Author(s), under exclusive licence to Springer-Verlag GmbH Germany, part of Springer Nature.