ISTANBUL — Shortly after an audio recording in which Prime Minister Recep Tayyip Erdogan is said to be heard talking about easing zoning laws for a construction tycoon in exchange for two villas for his family, SoundCloud, the file-sharing site where it was leaked last month, was suddenly unavailable to Internet users in Turkey.

Other recordings, also apparently from wiretaps connected with a corruption inquiry linked to Mr. Erdogan and those close to him, have shown up on YouTube, Vimeo, Twitter and other social media sites. Often, just as quickly as they appear, they disappear, only to show up soon after somewhere else on the Internet, like a game of Whac-a-Mole.

But now, facing a wide-ranging corruption investigation and a steady flow of embarrassing leaks, the government has moved to more aggressively control the flow of information online by passing — in a late-night parliamentary session on Wednesday — a new set of laws that would make it easier for government bureaucrats to censor the Internet.

Under the legislation, Turkey, which already has strict laws to regulate content online, will allow government officials to block sites they deem violate personal privacy, without obtaining a court order. It would also force Internet companies to retain the data — like emails and search histories — accumulated by their customers for two years, which some here worry could be used by the authorities to start criminal investigations.