Ex that is harrassing and degrading?

What can I legally do if my ex spouse constantly sends me texts that have nothing to do with the children. She sends me texts
calling me a deadbeat dad, I’m useless, derogatory names, derogatory names about my girlfriend?
Last year I tried to block her number but she brought it up to the judge during our divorce hearing and the judge told me to unblock it b/c I can’t
block her from communication due to the kids. What in the world is my next step to get her to stop.

You could file a motion to modify the child custody order, and ask the court to limit communication to that about the children, so you can have her held in contempt for her communications. Also, you could explore the use of a domestic violence protective order based on harassment.