A common worry is whether the other parent is doing and saying things to the child to undermine your relationship with the child.
This is a bigger problem for the child than it is for you. The child is in a difficult spot when one parent berates the other. By the time a child enters school, most children have developed a sixth sense for a parent’s emotional triggers. Children feel inadequate to handle it when someone pulls that trigger and will go out of their way to avoid upsetting the parent.
If a child speaks up to defend a parent, the child runs the risk of being called out or punished for being disrespectful. If a child keeps quiet, the child usually feels guilty about being disloyal to the berated parent. Children should be free to develop their own views about their parents, and as they grow older they will do so regardless of what parents say. By the time children reach puberty there is a keen interest in determining the truth for oneself. To do this a child compares what people say with what people do. Much more credence is given to what people do over what people say. It is sad to put a child in a loyalty bind that will have little effect over time.
Making disparaging comments about a parent is most likely to occur when the relationship remains intimate and intense. Emotions are raw and difficult to manage. A parent who slips into badmouthing mode should find another outlet for their anguish. If you are doing this, find an adult without direct connection to your child, such as a friend or counselor. If the coParent is doing the badmouthing, hopefully you are starting to realize that you can’t make the coParent stop. Transforming the coParenting relationship over time to a less intimate level will help.
The best remedy in your own control for badmouthing by the coParent is to forge a strong and positive relationship with your child. If you do not have any access to your child, you should seriously consider going to court to obtain an enforceable court order that preserves your child’s right to have meaningful contact with you.