MPs have voted to grant themselves anonymity if accused of sexual harassment or expenses fraud.

Minutes after the decision, a list of politicians under investigation vanished from Parliament's website.

One of the deleted cases was that of Labour's Keith Vaz, who is accused of bringing the House of Commons into disrepute by buying cocaine for male escorts.

Seventy-nine MPs voted against an amendment that would have ensured that the names of suspects in expenses cases would be published. The 22 who supported it accused their colleagues of a cover-up.

Minutes after MPs voted to give themselves anonymity if accused of sexual harassment or expenses fraud, a list of politicians being investigated is taken offline, among them Keith Vaz

The vote was over a motion to bring in a new code of conduct aimed at preventing a repeat of the sexual harassment scandal that shook Westminster last year. The code increases the punishments for abusing staff, volunteers or members of the public.

But the vote means that MPs being probed for misconduct of any nature will not now be identified. They will remain anonymous while being investigated – and might not be named even if they are judged guilty.

Until now the Parliamentary Commissioner for Standards had publicly identified MPs who are under suspicion, providing a summary of the allegations against them.

The watchdog looks into politicians who are accused of using information for financial gain, having a conflict of interest or generally damaging the reputation and integrity of the House of Commons.

The new code of conduct states: 'Members' behaviour is subject to levels of scrutiny unusual for staff.

The vote means that MPs being probed for misconduct of any nature will not now be identified. They will remain anonymous while being investigated – and might not be named even if they are judged guilty

'There is a balance to be struck between the need for transparency about law-makers' conduct and the danger that publication of unfounded allegations, or even minor transgressions, could have a disproportionate effect on the member.'

Justifying the use of anonymity, the policy states that the media might try to identify the complainant, putting people off coming forward with allegations.

In deciding whether to name the accused, the code stated that the commissioner should bear in mind 'the effect on the responder's reputation' and whether it is 'proportionate' to name them.

The motion set out that sexual harassment cases should be confidential – and the amendment would have prevented this anonymity applying to expenses as well.

But MPs voted for the motion and against the amendment, ensuring all parties in all investigations escape identification. In cases of sexual harassment the British legal system allows victims to remain anonymous, while the accused is named, in part to encourage other victims to come forward.

Yesterday, Commons Leader Andrea Leadsom urged colleagues to give the new code of conduct a 'clean run' by allowing anonymity for those under investigation.

But her pleas were challenged by MPs, including the chairman of the standards committee.

Labour MP Sir Kevin Barron moved the amendment that sought to ensure the names of individuals under investigation could be published.

'We have considered carefully the leader's argument for making this change and we understand why she has put them forward, but we do not think that they outweigh the reputational damage that may arise if we go ahead with this proposal as it is stated,' he said. 'It will be presented as MPs trying to cover up their misdoings.'

Sir Kevin added: 'Many people outside will criticise us for rolling back the openness that was agreed back in 2010 in view of the situation with the expenses scandal.'

His comments were echoed by other MPs. Labour's John Mann said: 'This process should all be transparent – the oxygen of good behaviour. The danger is that it ends up like the expenses scandal at some stage in the future.'

Fellow Labour MP Jess Phillips said if the criminal courts could maintain complete anonymity for the victims and complete transparency for those accused then she had faith that it could be done in Parliament.

She said: 'I do worry about how it looks in trying to pull back on transparency. I think the anonymity that is being required was a deal done by somebody in a whip's office or somebody on some committee that controls one of our political parties.'

Green MP Caroline Lucas said she did not believe the amendment would have undermined the confidentiality given to victims.

Mrs Leadsom earlier told the Commons parliamentary workers would now be free from 'unacceptable behaviour, bullying and harassment'.