PurposeThe study aims to analyze how occupational stigma consciousness affects workplace deviant behavior.Design/methodology/approachThe authors used a time-lagged research design. Data from 354 riders working on the platform were gathered, and multiple regression and bootstrapping were used to test the hypotheses.FindingsBased on the ego depletion theory and resource perspective, the study explores the relationship between the occupational stigma consciousness and workplace deviant behavior of platform riders in China. Occupational stigma consciousness promotes workplace deviant behavior; self-depletion mediates the positive relationship between occupational stigma consciousness and workplace deviant behavior and workplace mindfulness exerts a negative moderating effect on the relationship between occupational stigma consciousness and self-depletion.Originality/valueThe study provides a resource perspective to understand how occupational stigma consciousness is related to workplace deviant behavior and how workplace mindfulness alleviates resource depletion caused by occupational stigma consciousness. The research results provide practical information for managers to reduce deviant behavior, which helps to promote riders' performance on the platform.