In modern ecological systems, the overuse and misuse of antibiotics have escalated the prevalence of antibiotic resistance genes (ARGs) and mobile genetic elements (MGEs), positioning them as emerging environmental contaminants. Notably, composting serves as a sustainable method to recycle agricultural waste into nutrient-rich fertilizer while potentially reducing ARGs and MGEs. This study conducted a 47-day composting experiment using pig manure and corn straw, supplemented with chitin and N-Acetyl-D-glucosamine, to explore the impact of these additives on the dynamics of ARGs and MGEs, and to unravel the interplay between these genetic elements and microbial communities in pig manure composting. Results showed that adding 5% chitin into composting significantly postponed thermophilic phase, yet enhanced the removal efficiency of total ARGs and MGEs by over 20% compared to the control. Additionally, the addition of N-Acetyl-D-glucosamine significantly increased the abundance of tetracycline-resistant and sulfonamide-resistant genes, as well as MGEs. High-throughput sequencing revealed that N-Acetyl-D-glucosamine enhanced bacterial α-diversity, providing diverse hosts for ARGs and MGEs. Resistance mechanisms, predominantly efflux pumps and antibiotic deactivation, played a pivotal role in shaping the resistome of composting process. Co-occurrence network analysis identified the key bacterial phyla Proteobacteria, Firmicutes, Gemmatimonadota, and Myxococcota in ARGs and MGEs transformation and dissemination. Redundancy analysis indicated that physicochemical factors, particularly the carbon-to-nitrogen ratio emerged as critical variables influencing ARGs and MGEs. The findings lay a foundation for the developing microbial regulation method to reduce the risks of ARGs in animal manure composts.