PurposeThe main aim of this study is to integrate the theory of planned behavior (TPB) to examine consumers' intention to advocate for sustainable brands, whilst incorporating the moderating role of pro-environmental self-identity. Consumer sustainability orientation is also added as an antecedent for attitudes to determine the degree to which consumers' personal convictions and attitudes toward sustainability impact their attitude toward sustainable brands. The importance of using the TPB to study online brand advocacy lies in the accumulated evidence that shows that this theory is useful in explaining most kinds of social behaviors.Design/methodology/approachQuantitative research with the use of web-surveys is employed to test the research hypotheses with a total sample size of 536 respondents. Millennials have been chosen for the current paper to be studied.FindingsResults of the study showed that attitudes, subjective norms, and perceived behavioral control (PBC) were positively related to consumers' advocacy intentions. The findings of this study demonstrated that the TPB is applicable to measuring consumers' advocacy intentions. In addition, the results indicated that two dimensions of sustainability orientation, economic and social orientation, are significant predictors of attitudes. The study also found that pro-environmental self-identity does not moderate the relationship between the TPB core components and online brand advocacy.Originality/valueThis study is considered the first to employ the TPB as a theoretical foundation to test the antecedents of online brand advocacy (OBA) in relation to sustainable brands with the inclusion of consumer sustainability orientation as a predictor of attitudes with respect to the three dimensions of sustainability and the moderating effect of pro-environmental self-identity.