The dyeing, wastewater acidification and anaerobic treatment processes in the textile always produce a large amount of hydrogen sulfide (H2S), which will be harmful to the human beings. The fluorescent detection of H2S with highly specific and sensitive probe is of significance. Here, using the 2, 7-dichlorofluorescein (DCF) derivative DCF-MPYM as the fluorophore, a fluorescent probe M1 for specifically recognizing H2S was designed and synthesized by introducing 2-chloro-5-nitrobenzoic acid into the oxanthracene moiety of DCF-MPYM. The introduction of 2-chloro-5-nitrobenzoic acid results in DCF-MPYM being in a closed-loop state, thus, the fluorescence quantum yield (Φ) of the probe M1 was low. The characteristic of weak fluorescence plays an important role in the use of a fluorescent probe. The fluorescence titration and selectivity results demonstrated that the probe M1 could selectively detect H2S, and its detection limit for H2S was calculated to be 45.31 μM. The reaction mechanism of the probe was verified by the high-resolution mass spectrometry (HRMS) and liquid chromatography as the nucleophilic addition of H2S to the probe M1, which induced the cleavage of ester bond and subsequently restored the spectral properties of DCF-MPYM. To bring the probe M1 into practical application, the fluorescent aerogel CMC-M1 was constructed by mixing the probe M1 and carboxymethyl cellulose sodium (CMC-Na) aerogel, and the fluorescent aerogel can be applied in absorbing and removing H2S in water. The adsorption capacity and removal efficiency of CMC-M1 for H2S were 0.626 mg·g−1 and 99.36 %. The investigation of adsorption kinetic showed that the adsorption effect of CMC-M1 towards Na2S was mainly chemical adsorption. In addition, the fluorescent aerogel CMC-M1 can be applied for qualitative, quantitative detection and effective removal of H2S in dyeing and finishing wastewater.