BackgroundCarbon and nitrogen are essential energy and nutrient substances in the composting process. Corn steep liquor (CSL) is rich in soluble carbon and nitrogen nutrients and active substances and is widely used in the biological industry. Nonetheless, limited research has been done on the effect of CSL on composting. This work firstly reveals the effect of adding CSL to bacterial community composition and carbon and nitrogen conversion during composting. This study provides the choice of auxiliary materials for the spent mushroom substrate compost (SMS) and some novel knowledge about the effect of bacterial community on C and N cycling during composting of SMS and CSL. Two treatments were set up in the experiment: 100% spent mushroom substrate (SMS) as CK and SMS + 0.5% CSL (v/v) as CP.ResultsThe results showed that the addition of CSL enhanced the initial carbon and nitrogen content of the compost, altered the bacterial community structure, and increased the bacterial diversity and relative abundance, which might be beneficial to the conversion and retention of carbon and nitrogen in the composting process. In this paper, network analysis was used to screen the core bacteria involved in carbon and nitrogen conversion. In the CP network, the core bacteria were divided into two categories, synthesizing and degrading bacteria, and there were more synthesizing bacteria than degrading bacteria, so the degradation and synthesis of organic matter were carried out simultaneously, while only degrading bacteria were found in the CK network. Functional prediction by Faprotax identified 53 groups of functional bacteria, among which 20 (76.68% abundance) and 14 (13.15% abundance) groups of functional bacteria were related to carbon and nitrogen conversion, respectively. Adding CSL stimulated the compensatory effect of core and functional bacteria, enhanced the carbon and nitrogen transformation ability, stimulated the activity of low-abundance bacteria, and reduced the competitive relationship between the bacterial groups. This may be why the addition of CSL accelerated the organic matter degradation and increased carbon and nitrogen preservation.ConclusionsThese findings indicate that the addition of CSL promoted the cycling and preservation of carbon and nitrogen in the SMS composts, and the addition of CSL to the compost may be an effective way to dispose of agricultural waste.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12866-023-02894-x.