In this study, response surface methodology (RSM) was applied to optimize the preparation of a supramolecular gel temporary plugging agent. According to single‐factor experiments, results showed that the gelling temperature was preset at 100°C, and the gelling strength reached the maximum. Three‐factor RSM model prediction was carried out to explore the determination coefficient (R2) of the gelling temperature and strength and their degree of influence, and the predicted results were verified by experiments. No difference was found between the experimental results and the predicted results, indicating that this model could be used to optimize the preparation of DMF supramolecular gels. DSC, FT‐IR, XRD, and SEM were used to investigate the formation mechanism of the optimized supramolecular gel temporary plugging agent (CD‐Da), and its compatibility, stability, rheology, and plugging performance were evaluated. Experimental results showed that CD‐Da has the characteristics of good injectability in low‐permeability rock cores, strong plugging capacity, self‐breaking, and less damage to the formation. Therefore, this study not only provides a stable and efficient supramolecular gel plugging agent for tight oil and gas reservoirs, but also establishes a prediction model between each component and supramolecular gel, providing a new optimization method for the preparation of supramolecular gel.