Background: Treatment failures (TFs) generally exist in the course of ulcerative colitis (UC), while early reliable predictors of TFs are still lacking. We aimed to generate nomograms for the prediction of TFs. Methods: In this retrospective case-control study, the endpoint was the occurrence of TFs, which included medically associated treatment failures and surgery-associated treatment failures (colectomy). Clinical features and mucus integrity evident by goblet cells (GCs) number, expression levels of MUC2 and SLC26A3 were enrolled in the univariate analysis. Nomogram performance was evaluated by discrimination and calibration. Results: We identified 256 UC patients at our center from January 2010 to June 2022. Fourteen variables for TFs and 9 for colectomy were identified by univariate analysis. Five baseline indices were incorporated into the nomogram for the prediction of TFs: area of GCs, age at diagnosis, disease duration, hemoglobin, and Mayo score. The model was presented with decent discrimination (C index of 0.822) and well calibration. In addition, the colectomy predictive nomogram was built using MUC2 intensity, age at onset, and Mayo score with a good discrimination (C index of 0.92). Conclusion: Nomograms based on comprehensive factors including mucus barrier function were developed to predict TFs in UC patients with great discrimination, which may serve as practical tools aiming to identify high-risk subgroups warrant timely intervention.