The wish of a child is taken into consideration when the judge decides how to assign custody and access rights. A parent may be blamed for acting irrespective of what the child wants after separation.
Of course, the age and maturity of the child will influence the weight that the judge will give to his will. For example, a 12-year-old child can decide on the choice of his family environment without this choice being automatically followed. On the other hand, the will of a child of 17 years will be very determining in the choice of the custodial parent, while the wish of a child of 4 years will have practically no weight.
The parent must avoid “contaminating” the child’s perception by demonizing the other parent, which could be considered parental alienation.