The Everton winger says he rises above the comments but knows colleagues in the dressing room who have found them hard to deal with.
"I don't let it affect me and words can never hurt me," Townsend says. "But I have had team-mates in the past who have taken offence to comments online, to the extent where it has affected them before a game.
"Everyone is different and you can't tell one person from the other how to feel when they receive racist abuse and I've certainly had team-mates who have been affected by it more than myself."
Townsend has spoken previously of his issues surrounding mental health as part of his support for the Premier League's #StayWell hub, which shares guidance from experts, players, the United Kingdom's National Health Service and national organisations to help supporters stay strong and positive.
And whether it is discriminatory abuse or negative comments, Townsend believes every individual has the ultimate responsibility in making sure they consider other people's feelings before posting.
"It starts with ourselves," he says. "Look in the mirror, make sure you're behaving in a way you'd like other people to behave and that you're not making comments that you wouldn't like to read.
"Everyone at one point or another has struggled with mental health. That's the thing we have realised over the last year or so since more and more people have spoken up.
"There shouldn't be a stigma around mental health because it affects everyone. On social media, everyone maybe not abuses but makes negative comments in one way or another, without even thinking."
Also in this series
Part 1: Players reinforce there is No Room For Racism
Part 2: Mings: Coady's support vital in fight against racism
Part 3: Dier: Talking is an ideal way to show allyship
Part 4: Ferguson: Diversity is our soul
Part 5: Lookman: Education is key to phasing out racism
Part 6: Matip: Taking the knee sends important message
Part 7: James: Standing up to discrimination is so important
Part 9: Rice: People who are abused should never be alone
Part 10: Kabasele: We cannot give up discrimination fight
Part 11: Chalobah: It's important players set the standards