The row was prompted by a Facebook post by the force to celebrate the confiscation of a small amount of cannabis earlier this month.
Sarcastic comments posted by people responding to the announcement included quips such as: "Wow that’s put a dent in the war on drugs lol" and "Hope you manage to nail Pablo Escobar this afternoon."
However, the force failed to see the funny side and reacted by posting a statement which warned: "This is a Police page and whatever your thoughts on one of my officers seizing drugs in the community, being insulting, abusive or offensive can and will result in a prosecution under the Malicious Communications Act 1988."
For the avoidance of any doubt, the statement posted by Inspector Martin Mozier said: "Please use this page with respect or you will be banned and maybe even prosecuted."
The approach resulted in a series of stories in the mainstream media.
One article, in The Sun, carried the headline "Law’s a grass" with a sub-headline "Police threaten to arrest Facebook jokers who mocked their tiny cannabis bust".
Nigel Swift, head of corporate comms, West Yorkshire Police, told PRWeek that the force is "extremely active on social media and we find it a really effective way of engaging with and informing local communities".
Referring to the post that had prompted ridicule among some people, he said: "In this instance, concerns about cannabis use had been raised with the local Neighbourhood Policing Team by residents in that area and one of the ways the team communicated they had taken action was via their local Facebook page."
Swift commented: "While we absolutely respect the right of people to make reasoned comments, or to disagree with us, grossly offensive language is both unnecessary and unacceptable."
He added: "We want our social media content to be as accessible as possible, so removing inappropriate or offensive comment is something we will continue to do."
Referring to the threat of arrest, he said: "The warning about malicious communications was primarily intended to make people think about what they are posting on social media."