Hundreds of police officers and staff have been investigated for posting racist, homophobic and threatening messages on social media, a Freedom of Information request has uncovered.

More than 70 have retired, resigned or been sacked over the past five years in some of the most serious breaches that have come to light.

The cases that were investigated included an officer who posted information about a planned police operation, and a member of police staff who harassed a former partner on Facebook. Other cases included a community support officer in Devon and Cornwall who was given a written warning for posting photos with weapons, and two special constables in Northampton who resigned after they were pictured in a “compromising situation”.

A civilian officer posted a comment on a Facebook account regarding the actions of Muslims in central London failing to observe a two-minute silence. It was alleged the language used “could be regarded as offensive, inappropriate or likely to cause offence”, police said.

Forces said there had also been inquiries into comments that were deemed homophobic, racist or “religiously aggressive”. Greater Manchester Police, the country’s third-biggest force, reported the most investigations at 88, followed by the West Midlands, with 74, and the Metropolitan Police with 69.

The investigations appeared to cover all five areas of risk identified by the body representing senior officers in guidance published earlier this year. They included a potential breach of operational information, breach of trust and bringing discredit on the police service.

The guidance also warned officers against posting messages after drinking alcohol, listing social events they were due to attend, or putting up personal details that could result in them being harassed or blackmailed by criminals.

Forces are increasingly making use of social media for witness appeals and officers have been encouraged to post pictures and stories of life on the beat.

But the rise of social media has raised concern that police are spending too much time policing abusive comments on platforms such as Twitter – apparently including some by their own officers – and some have fallen foul of their overzealous use of social media.

The Freedom of Information request by the Press Association news agency to the 43 police forces in England and Wales found that 828 cases were reported to senior police.

PC Tony Ryan has been sacked for allegedly running a Twitter page criticising his own bosses (SWNS)

Two-thirds of the cases related to police officers with the rest civilian staff or community support officers. About a seventh of the cases resulted in no action being taken.

The responses were not limited to messages posted: one police constable resigned over the excessive and inappropriate use of the internet that included auction sites, internet banking and social networks. Another member of staff was photographed asleep in the control room – and the picture posted on Facebook.

Chief Constable Alex Marshall, the head of the College of Policing which drew up a code of conduct for all officers, said: “Where people working in policing have undermined their own reputation or that of the wider service, they must face appropriate action. There is no place in policing for officers who abuse the trust placed in us by the public.”

The code of ethics says nothing published online should be perceived as “discriminatory, abusive, oppressive, harassing, bullying, victimising, offensive or otherwise incompatible with policing principles”.

Forced out: dismissed over abuse

A sergeant at Avon and Somerset Police was sacked this year after allegedly sending more than 800 tweets that criticised his force and senior officers. Tony Ryan, 33, claimed he was not responsible for the tweets on the @TheBritishCop account, which claimed that hard-working officers were treated like garbage by “scum” bosses.