She might be having an anal fissure
. You can have it checked by a general practitioner too.
Usually fissure happens when constipation
had been there for some time. When there is a fissure, the pain is so severe that kids start holding the stools to avoid the pain. This holding in turn causes hardening of stools and sets up a cycle.
Good that you have modified his diet. Continue with that.
You might also use medications like Lactulose
for 2 to 3 weeks- that will help her pass stools at ease. The dose will be 1ml/ kg to start with, given each night. Depending on the response, the quantity and interval of dosing
may be adjusted.
You may also give concentrated sugar solution daily with lot of water and fresh fruit juices.
If she has a fissure, local anesthetic
gels will be needed for about 2 weeks.
Hope my answer helps you.