Quercetin and kaempferol are flavonoids widely present in fruits, vegetables, and medicinal plants. They have attracted much attention due to their antioxidant, anti-inflammatory, anticancer, antibacterial, and neuroprotective properties. As the guarantee cells in direct contact with germ cells, Sertoli cells exert the role of support, nutrition, and protection in spermatogenesis. In the current study, network pharmacology was used to explore the targets and signaling pathways of quercetin and kaempferol in treating spermatogenic disorders. In vitro experiments were integrated to verify the results of quercetin and kaempferol against heat stress-induced Sertoli cell injury. The online platform was used to analyze the GO biological pathway and KEGG pathway. The results of the network pharmacology showed that quercetin and kaempferol intervention in spermatogenesis disorders were mostly targeting the oxidative response to oxidative stress, the ROS metabolic process and the NFκB pathway. The results of the cell experiment showed that Quercetin and kaempferol can prevent the decline of cell viability induced by heat stress, reduce the expression levels of HSP70 and ROS in Sertoli cells, reduce p-NF-κB-p65 and p-IκB levels, up-regulate the expression of occludin, vimentin and F-actin in Sertoli cells, and protect cell structure. Our research is the first to demonstrate that quercetin and kaempferol may exert effects in resisting the injury of cell viability and structure under heat stress.