Warning: This is going to get graphic. And you may not like this. I've been through it personally twice:
It may very well NOT be a behavior issue, but a physical one.
In our family about one child in four is born with near adult sized intestines. You can imagine how painful it is to eliminate with adultish intestines and a childsized rectum because you had a child. Honest to god, birthing my son hurt about the same amount as many (not all, but many) of my bm's as a child. I was actually surprised that it didn't hurt more to have a baby (given all the fuss)...and was actually able to use many of the "tricks" I'd learned as a child pooping.
Laxitives only made the situation worse...the intestines were too big...laxatives just made them fill up that much faster, cause cramping, and panic. I remember withholding, and "marking" my underwear...but still withholding because i was deathly afraid of the pain AND how angry my mum got at me (i was the only on of her children who had this issue).
To parallel, yet again, if you were afraid of the pain of childbirth (and we get babies out of that pain!!! And it only happens at most twice a YEAR, not twice a week!!!), look closely at your daughter...and see if you see yourself then in her now.
My son also has this problem. Since he was a year old (and started eating solids as his primary nutrition source), I've spent hours and hours rocking him in my lap while he cried from the fear and pain, applauding his efforts, reminding him that as he gets older it hurts less and less, telling him how brave he is, "admiring" his handiwork (ugh), and holding his hand (literally).
At nearly 7, he doesn't need me to hold his hand, or the constant support...but he's had years in which to learn to build his courage, face his fear, and accept that (even severe) pain is sometimes a fact of life. And he IS very brave. Can you even imagine going into labor once a week, much less 3 or 4 times???
My mum lost her patience with the whole thing when I was probably about the same age of your daughter. The next four years were misery for me. Force fed laxitives, milk of magnesia (the smell STILL makes me want to vomit), shoved enemas into me, in general acted like I was doing "this" to make her life difficult. I was slapped, spanked, all of my "friends" (toys) taken away from me, punished every which way from Sunday. All for something that I couldn't control. Fear.
I remember crying myself to sleep at night, knowing that she hated me, no matter how often she said otherwise. I remember knowing that I must have been stupid, to not understand something she thought was so simple, and there must have been something wrong with me. Seriously wrong with me, because no matter how hard I tried I couldn't get something so simple "right". Failure. Disappointment. Better off dead and out of her life.
Can you imagine? A six year old who had everything in the world (loving family, great friends, an interesting life)...who had never even heard of suicide thinking those thoughts and feeling that way??? My mum had built a brilliant foundation based on love and trust, she was everything wonderful in the world...so I knew for her to "hate" me so much it had to be something intrinsically flawed with ME. And believe me...4 years of disdain, anger, punishment, and frustration over something even as trivial as POOP..if it happens twho, three, four times a week...can have that effect. It can destroy a child's self worth, and a parent's relationship with that child for YEARS...no matter HOW WONDERFUL my mum was the rest of the time.
Eventually children's rectums get bigger and it doesn't feel like childbirth anymore. For most of the people I know this happens around age 8, although it continues to hurt (a lot) until we're actually adult sized.
My mum (obviously) used fear and shame and punishment...and I remember swearing to myself that I would never be like that to my own kids. My cousin had the same problem, but my Aunt is rather the polar opposite of my mum, so my cousin was never in fear of punishment as well as pain. So the way we've handled our son is a combo of both what I'd WISHED my mum had done for me, and what my aunt actually did for my cousin:
A few tricks:
- The opposite of fear/punishment/shame: Constant support and praise. He's the one in pain, not me, so I figure I owe it to him to both let him know how brave he is, and that I'm proud of him for it. Bravery is not having no fear, bravery is being afraid and doing the right thing anyway.
- Allowing him to poop in a pull-up until he was 4.5 (The way we sit on western toilets is actually not the easiest physical position. The squat that toddlers do in diapers, or that EVERYONE uses in Asian style toilets is actually way easier).
- A LOW fiber diet
- Tylenol 20 minutes beforehand (rarely)...you know what I mean. You frequently know HOURS beforehand, and from their face/eyes you can tell if it's going to be a bad one.
- Let them take a dab of vaseline with their own finger and dab their own bum (not only does that let them feel more in control...but if it's big it means they're less likely to tear, and if it's acid...the vaseline keeps it from burning).
- Lamaze or other kind of focused breathing (works wonders!!!)
- Other relaxation under stress techniques. For my cousin, it was being able to read a book. For others, it's privacy, or meditation, or music, or rocking, or math problems.
The good news: All of us grew out of it, and none of us hate our mums (as adults). But whatever you do, my strongest possible recommendation, is to be gentle with your little one. She's learning some hard lessons right now.