The Rugby Football Union has welcomed legislation it believes will allow it to prevent tickets being resold at inflated prices on the secondary market in the buildup to the World Cup.

Lord Moynihan, the former Conservative sports minister and British Olympic Association chairman, has piloted an amendment to the Consumer Rights Bill through the legislative process despite initial government opposition.

It is hoped the legislation will be in place by July, allowing sports governing bodies and music venues to cancel tickets under their terms and conditions if they believe they are being sold at a vastly inflated price. Already, tickets for the Rugby World Cup are widely available on secondary sites at prices of up to £5,000 for the final at Twickenham. Prices for group stage matches, involving England, start at more than £300.

The measures will also mean anyone selling a ticket on a secondary site such as Viagogo or Seatwave will have to provide details of the seat row and number, as well as the face value, by law – a move governing bodies hope will cut down on fraud.

The change in the law has been subject of a vicious behind the scenes battle, with the bill passing to and fro between the Commons and the Lords before the government backed down and accepted a new version of the amendment. A cross-party coalition of peers, including Baroness Tanni Grey-Thompson, had backed the idea of action since the first reading of the Bill in November last year.

The government U-turn, in the face of opposition from the culture secretary, Sajid Javid, was believed to have been motivated by a desire to get the bill passed before the election.

“All too frequently we have seen fans subject to sky-high prices, mis-selling and fraud when buying tickets on the secondary market. We are delighted to see the government has supported an amendment to the Consumer Rights Bill which introduces much needed transparency into the market,” said the RFU chief executive, Ian Ritchie. “This is a very good day for rugby fans and we must pay tribute to Lord Moynihan and the numerous other peers who have worked tirelessly on this issue. We hope to see this effective in time for the Rugby World Cup.”

The changes have been bitterly resisted by secondary ticketing sites, a marketplace that has boomed in recent years. Critics claim it has led to a rise in part-time “bedroom touts” and has been seized on by organised criminals using computer programs to corner the market and then resell at high prices. The secondary ticketing sites argue they are providing a valuable service and most consumers want the ability to resell and buy tickets. They also say they already provide protection against fraud by offering a full refund on any tickets that fail to turn up as advertised.

After failing in an initial bid to get the government to change the law and make the resale of Rugby World Cup tickets illegal, as with all football matches, London 2012 and the Glasgow Commonwealth Games, England 2015 was resigned to relying on warning fans not to buy on the secondary market because they might not be allowed in. The new rules will allow governing bodies to cancel tickets they believe are being sold at unfairly inflated prices. They insist they will not go after those reselling tickets for legitimate reasons at or slightly above face value.

Debbie Jevans, the England 2015 chief executive, said: “We have long supported legislation which protects the consumer, so we welcome this amendment and hope that legislation will be in place in time for the Rugby World Cup.”

The government has also promised a review of the entire sector. “This government believes strongly in our sporting and cultural sectors. The provisions agreed today will allow them to flourish, whilst ensuring consumers are better informed when buying second hand tickets,” said a spokesman.

“But we recognise this is a complicated market, so we are commissioning a full, independent review of consumer protection measures. The review will examine issues around access, for example when tickets sell out within a few minutes of going on sale, and examples of good practice by events organisers which minimise abuses.”

Whitehall sources also said that any action against indivduals would be subject to a fairness test, allowing those re-selling for legitimate reasons to recoup costs associated with travel and accommodation.

Ticketmaster, which owns Seatwave, said the success of the amendment would depend on how it was adopted by sports governing bodies and venue owners.

“We fully support increased transparency, so every fan can be confident they are buying a legitimate ticket. We therefore hope this new regulation will be used as an opportunity to put fans first, improving their access to tickets, as well as allowing them to transfer their tickets to others in a safe and transparent marketplace,” said a spokesman.

A spokesperson for Viagogo said: “It’s business as usual at viagogo. Ticket resale was legal yesterday, is legal today, and will still be legal tomorrow.”