Gandalf is spot on and I was going to say the same. When I was a teen I was subject to continuous low level bullying - exclusion, jibes dressed up as jokes etc. I really wanted to stay part of a friendship group I was being Wendied out of and was coming across very needy.
I was very ill over the Summer holidays with septicaemia and spent several weeks in hospital. I learned to enjoy my own company, the staff all thought I was lovely and it gave me a real confidence boost that I needed to see I had value outside of this group. I returned to school with virtually no friends and basically what can only be termed as 'not giving a shit' about what others thought. It was GCSE year so I told myself I only needed to go in, do my work and go home again for 9 months and it would all be over. (Before social media - I don't know how it would have been if that had been around)
To my surprise, by the second week of the year everyone wanted to be my friend, and the Wendy wanted to draw me back into the group so that I didn't take her power away. But because I now had no interest in doing that I spent the year drifting between several groups of people on my terms and actually had a pretty good time.
Long story short, I have used this technique over the years any time I feel a group is a bit cliquey, exclusionary or snide. One example is the school mums - the Queen bee is a total social climber who can get literally nothing from me so often is quite dismissive. I give no shits about her and am friendly with others in the group and suddenly she's thrilled to see me and inviting DS for playdates and me to prosecco parties (which I go to every now and then, but don't make myself too available).
At work I just don't add anyone on social media. Ironically the people I would add don't have it! In my role I'm not there to make friends (pretty hard when you have to tell people all the errors they're making and retrain them) so I actually don't give a shit about being friends with colleagues. That makes me sound awful, but I'm nice and polite and tactful; and we have a great team dynamic and all get on. I think with work social media definitely can blur boundaries and leaves you wide open to office bitchiness, gossip and politics. It's never a good idea to give too much of yourself away and social media forces us to do that.
Play your cards close to your chest, value yourself and what you do and give no fucks what they think. As long as you know your worth and are confident in that, they will follow. Like Gandalf said - when you stop fawning over them they'll stop treating you badly.