The effective elimination of pathogens during the composting process is essential for ensuring the safe utilization of organic fertilizers and maintaining food security. However, the development of innovative, cost-effective, and environmentally friendly techniques for pathogen eradication remains insufficient. Actually, the improper disposal of shell powder, a prominent by-product of the seafood industry, can result in environmental pollution and the wastage of resources. The present study examined the effectiveness of incorporating shell powder as a composting amendment for the efficient eradication of pathogens. Metagenomic and metabolomic analyses were utilized to elucidate the underlying biological mechanisms. Our findings revealed that the addition of shell powder enhanced compost temperature, pH, electrical conductivity, and extracellular enzyme activity, creating a conducive environment for pathogens elimination. Furthermore, fungal diversity was positively correlated with pathogens abundances. The addition of shell powder altered critical compounds levels such as 11(E)-Eicosenoic Acid, Arachidonic Acid, Daidzein, and Erucic Acid, resulting in reduced fungal diversity during the thermophilic phase and indirectly suppressing the pathogenic fungi abundance. Additionally, anti-pathogenic metabolites were induced after shell powder supplementation demonstrating greater diversity including alkaloids, terpenoids flavonoids and phenolic compounds exhibiting higher selectivity and specificity for different pathogens. In conclusion, incorporating shell powder during composting is recommended as a viable strategy for utilizing seafood waste resources, reducing pathogen risks, and thereby enhancing the quality of organic fertilizer.