Girls of 8, 9, and even 10 can be very slovenly. There can be reasons for this though, and they need to be addressed before you will get anywhere.
Sit yourself down and answer the following questions as honestly as possible - is your daughter playing a part in a power struggle or any other relationship dynamic between you and her other parent? If there isn't an issue like that between you and your ex, could your daughter herself be stuck in a place where she can't separate herself from her parents' relationship and is unconsciously trying to get both of you to react to her instead of to each other?
Is there stress in your daughter's life?
Does she have friends and is it possible to keep in touch with them at this time? FaceTime, etc..
How is her self esteem in general?
Is she neat or messy apart from the haIr? Room, personal belongings...
When school was a thing, did she forget a lot of things she needed for school, or lose belongings, or forget to bring home books for homework?
Does she willingly take a shower or bath daily?
Does she bite her nails or keep them longer and neat?
Does she change her underwear daily, change clothes daily, and put items she takes off in a laundry basket? Or is this habit one she resists?
If everything feels like a struggle it may well be that she's lacking in self esteem, or is feeling inadequate in some way.
8-10 can be a strange age. You're not a little kid any more but you're not yet trusted to take care if yourself. Some of your schoolmates may have older siblings and may be flaunting 'mature' behaviour and speech and references to pop culture that an only or oldest child might not have encountered at home. You might have feelings if inadequacy as a result. You are aware of the wider world but you are primarily a home person still.
As a parent, it might be helpful if you stepped back from the obvious problem and began a campaign of boosting your daughter's self esteem instead.
You can do this by working with her in your home in a consistent and disciplined and cheerful way, doing chores together, cooking together, deciding on meals together, maybe learning s new skill together like crochet or coding or watercolour painting.
Becoming competent at cooking and doing her own laundry is a huge self esteem booster. 8 is the ideal age to start this. Being given responsibility for a pet is an additional competence and confidence booster. (This all goes for boys too).
As well as that I recommend you buy for her a really useful book on what to expect in the next few years.
'The Care and Keeping of You' is published by American Girl publishing. It covers puberty and physical development, but also things like hygiene, diet, getting enough sleep, wearing clean clothes, friendships and personal responsibility, and all in a positive, encouraging tone.
Don't focus on the hair but in the wider picture, and the hair thing will fall into place. Make sure your DD knows you are a fan of hers and appreciate her contribution as you work together.
If you think it would work, mention to the other parent that your DD is just about at an age when girls can get nasty to the girl who is perceived as smelly or dirty, and that it's important to protect her from that fate. It's hard to recover from that reputation so best to prevent it in the first place.