Whenever someone chooses to leave social media, you hear the same refrain: it’s gotten so negative, I can’t stand it. To me, that’s a reason to stay.

Don’t get me wrong. I’d rather hang out with people who like me in real life, and I’d certainly rather hear praise than criticism. But when it comes to building an audience online, it’s better to be hated than loved. For better or worse, social media rewards engagement, and negativity fuels engagement.

You may have heard the old saying, “All publicity is good publicity.” But I’m here to tell you that the best publicity of all is absolute hatred. Your online haters can inadvertently give you effective marketing, spread your name to new groups, give you opportunities to respond persuasively, and sharpen your brand.

Once you recognize this, haters also lose some of their power. They may try to bring you down by making you feel small or unworthy. If they make you feel bad, provoke you into an ill-tempered response, or drive you offline, they win. But once you realize they’re inadvertently boosting you, it’s an opportunity to turn that dynamic around.

I’ll give you an example: the online trick shot group Dude Perfect. These five guys have filmed themselves doing everything from calling and making a hole in one to sinking a basketball from a skyscraper. They’re good, and their online comments reflect viewers’ utter disbelief. And not just stunned amazement or polite questions about the veracity of videos—they deal with everything from scorn to conspiracy theories. This is a level of mastery everyone should aspire to and something I write about in my book So Good They Call You a Fake.

In an interview on Good Morning America, Dude Perfect member Cody Jones said the group loves it when people call their shots fake because it makes what they do “seem even more ridiculously impossible,” leading to more publicity and clicks on YouTube. Online haters are literally putting money in their pockets.

Now, not all online hate is created equal. When people are responding to you with racial hate and bigotry, their comments obviously provide no value. It’s best to report and block these people rather than engage with them.

The haters I’m talking about are people who come at you because of what you do. They’re the ones who criticize you because you’re talented or smart or successful—and they simply can’t stand it. For that reason, they try to cast doubt on your achievements and minimize your talents. These haters and trolls, who tend to move in packs, will latch onto something you say and begin circulating it among themselves, adding their own put-downs. But their attacks merely serve to elevate your standing online.

You may have heard the old saying, ‘All publicity is good publicity.’ But I’m here to tell you that the best publicity of all is absolute hatred.

I’ll give an example from my social media feed. Last year, I was musing on the flaws of some popular movies, which could help authors more effectively write books. I went onto what was then still called Twitter, and shared a thread of my observations about how Captain Marvel, Rey from Star Wars, and Bo Peep from Toy Story were examples of what fans call a Mary Sue—a character with no flaws or weaknesses. I argued that this robs them of narrative arcs and obstacles to overcome, and ultimately is a disservice to viewers who want to see a strong female character.

My core audience—people who want to improve their writing or just enjoy well-told stories—loved my posts, but soon a new audience of haters found them and were determined to argue with me because I had criticized popular female characters. These haters seemed to be responding more to one another than to anything I’d written, high-fiving one another with each withering reply. [pullquote align=right]

The attention drew thousands more people to the posts, as the site’s algorithm decided this was something people would engage with. That, in turn, led to news coverage, as outlets that cover social media closely began writing about the incident.

If I were easily bothered, I might have felt defensive about the attacks. But I didn’t let them get to me. I replied when necessary, let others duke it out in my defense, and watched as the engagement grew overnight. By the next day, I had a whole batch of new followers and news coverage that increased Google searches of my name—and all the hard work was done by my haters.

Joshua Lisec is a ghostwriter of more than 80 books and author of So Good They Call You a Fake.