Leading politicians from major parties have signed a pledge to avoid hateful language during the general election campaign, as a growing number of MPs cite relentless abuse as their reason for stepping down from parliament.

The group Compassion in Politics has launched #StopTheNastiness, which aims to encourage candidates to “campaign with respect, call out hate, and promote compassion” over the next six weeks. It also urges the public to contact their local representatives and ask them to back the pledge, and calls on the media to avoid exacerbating abuse.

Matt Hawkins, who co-founded the group, said it hoped to instil ideas about decency and compassion at the heart of British politics, which has become increasingly divided since the Brexit referendum. He said one particular focus was to stop the abuse of female MPs who have said they feel their lives are in danger when they go out campaigning.

Hawkins accepted there were times when forceful language is justified “if you’re coming from a place where it’s concern for humanity”, such as when a politician highlights links between austerity policies and the deaths of vulnerable individuals, but said the aim should always be to win others around to your argument rather than being needlessly abusive.

The campaign has received cross-party support, including politicians from Labour, the Conservatives, the Greens and the SNP in addition to faith groups such as the Muslim Council of Britain and Jewish Council for Race Equality. Members of the public will also be encouraged to call out hate online by using the hashtag #StopTheNastiness, and the campaign group will also distribute badges and stickers carrying the slogan while campaigning.

The Archbishop of Canterbury has also said that strong language by MPs risks “pouring petrol” on the current political situation, and a growing number of female politicians have talked about the vitriol they receive and its impact. The departing Conservative cabinet minister Nicky Morgan said she had decided not to stand again in part because of the level of abuse she received.

Rosie Duffield, the Labour MP for Canterbury who is standing again, said she had been shocked by what she had encountered in her first two years in parliament. “Behaviour that is tolerated in politics would be considered obscene in any other walk of life,” she said. “Verbal and physical threats, xenophobia, sexism, bullying and intimidation, we were meant to be wiping these from the face of our society. Instead we’ve allowed politics to become their breeding ground.”

The campaign may face a challenge in an election expected to be high on emotion and an increasingly partisan media environment. Leading politicians have been accused of stoking divisions by using inflammatory language, notably when Boris Johnson described death threats against MPs as “humbug”.

A recent analysis by the Financial Times suggested there was a direct correlation between the language used in parliament during that debate and the volume of toxic tweets from both sides of the Brexit divide.