Any attention is good attention for toddlers they don’t quite understand yet. My LO has done it less and less. We firmly say, “you don’t hit mummy/bite mummy” and put him down or move away from him. He cries or fusses for a bit then when he stops he’s comes over for a cuddle. He doesn’t really do it much anymore. Wether he’s just grown out of it or what we we’re doing had any influence I don’t know 🤷 😂😂🙈
Reinforce the boundary calmly but clearly with a No or No thank you. You could add No biting/hitting, that's not kind. Exaggerate your facial expression to show you don't appreciate being bit or hit, and you might have to state No, it's not funny, depending on their response (if they laugh). When they know they've done wrong, and become upset, let them come to you for a cuddle to show they're ready to repair the relationship, and then engage them in play after they've calmed, to show there's no hard feelings. At this age it's a developmentally normal stage and should pass in time, hard though it is right now.
I’m struggling with the biting too. I’ve always said no and no bite mummy. He does understand but it’s when he’s tired or trying to show love and affection mostly. Now he’s understanding more I say mummy needs a time out and when he’s trying hard to win back my attention I’ll just say no, mummy needs time and no bite mummy - for a few mins then we start playing again and have a cuddle.
My son has done this since turning 1, I wouldn't ignore as they arent acknowledging it's wrong to do. Say no, and move them away from doing it more. At the moment I'd say it's a phase babies this age go through