If the NYPD keeps letting loudmouths harass cops, disaster is sure to follow.

As The Post has reported, vulgar tirades against officers are on the rise, and cops are ignoring them — based on orders, sources say, from on high. Three videos show cops doing their best not to respond to a rash of obscene barbs meant to provoke them:

“Get the f - - k out of my building,” a cop-hating moron yells during a lengthy rant at officers. The police simply walk away.

“Tell your daughter to . . . suck this d - - k,” Christopher Roman, 20, shouts at cops who’d searched him because he matched the description of an armed suspect. He wasn’t the guy, but the officers let him berate them for nearly five minutes before finally arresting him for disorderly conduct.

A man screams profane insults at a sergeant while filming — right in the middle of a police station.

The cops’ restraint is impressive. And it’s understandable that they don’t want to arrest someone unnecessarily, inflame a volatile situation — or risk disciplinary charges for overreacting.

But letting hooligans taunt cops is asking for trouble. Provocations can escalate and end in violence. And who’ll join a force whose members can be tormented with impunity?

Most important: Disrespecting the men and women who protect the public is unhealthy on a broader scale — especially when videos of the abuse are posted online.

Mayor Bill de Blasio denounced the incitement Monday. That’s not enough, not when he has signed a spate of laws that aim to handcuff cops and second-guess their actions — and even says he told his son to beware dealing with the police.

In a Post column, Police Commissioner James O’Neill calls the idea of an NYPD “hands-off” policy “nonsense.” Rather, he “trusts” his officers to make “split-second” decisions and “take enforcement action when appropriate.”

Yet the videos clearly show police hesitating in the face of abuse. O’Neill needs to put an end to that. For the sake of his cops — and the public.