PurposeUsers frequently target rival brands through direct criticism or indirect customer insults, yet the impact of such attacks on brand advocacy remains unexplored. The purpose of this study is to classify online attacks into brand-targeted attacks and consumer-targeted attacks and further investigate their differential impacts on brand advocacy and the underlying mechanism and a boundary condition of those impacts.Design/methodology/approachThree experimental studies using different types of brands (electronics, universities and sports footwear) are conducted to examine the effects of brand-related attack targets on brand advocacy.FindingsThis research shows that consumer-targeted attacks trigger higher brand advocacy through increasing perceived identity threat than brand-targeted attacks. Moreover, the effect of consumer-targeted attacks (versus brand-targeted attacks) on brand advocacy is mediated by perceived identity threat and mitigated when consumers’ identification with the attacked brand is strong.Practical implicationsThe study’s findings yield practical applications for marketers and brand managers, assisting them in understanding consumers’ reactions to brand attacks. This study serves as a reference for firms to consider leveraging the association between brand identification and brand-related attack targets and uniting with loyal brand fans to manage online brand conflicts.Originality/valueThe present study extends prior literature on customer-brand relationships in the context of online attacks. Through investigating the impacts of brand-targeted and consumer-targeted attacks on brand advocacy, this research offers theoretical insights into consumers’ responses to online attacks with different targets.