Before former Mayor Michael Bloomberg and his Transportation Commissioner Janette Sadik-Khan ceded wholesale control of Times Square to “pedestrians” in May 2009, the “Bow Tie” where Broadway and Seventh Avenue cross was rightly considered a commercial miracle. A site that previously crawled with muggers, drug dealers and hookers welcomed great companies in gleaming new office towers.

What’s happened since then is a lesson in unintended consequences. Indulging a socio-political agenda — a pathological hatred of cars, which are only owned by a mere 222 million Americans and by 1.4 million households even in supposedly auto-shunning New York City — has set Times Square up for disaster.

Since then the plazas became a clown circus ruled by tourists and cash-hustling Elmos. Roving cartoon characters and burger-chomping visitors from Oshkosh are great for the hotel industry, but they stink for everyone else.

Times Square went from a tourist destination that was part of the city to a tourist destination apart from the city. A facsimile of what people think New York is like — tall buildings, loud noises, lots of people — yet isn’t really what New York is.

So far, four huge companies have either recently fled the Bow Tie or are on their way out. And more will likely follow. Unless the floors they vacate are rented to new tenants practically overnight, Times Square — the office market’s Cinderella neighborhood just a decade ago — will have the highest vacancy rate in the city.

Condé Nast left in 2014. Law firm Skadden Arps and accounting giant Ernst & Young will both be gone next year. The three companies were based in two of the four 42nd Street towers that went up from 1998-2002 and were the anchors of the “new” Times Square. In another big defection, global law firm Pillsbury Winthrop left nearby 1540 Broadway for West 52nd Street in 2018.

Stores that drew at least some real New Yorkers were driven out by generic chains with greater tourist appeal. The great Virgin megastore gave way to Forever 21. Toys “R” Us at least had a Ferris wheel to distinguish itself from other chains; now it’s Gap and Old Navy. MTV closed its famous studio at 1515 Broadway in 2009 at exactly the time that Broadway was closed to vehicular traffic.

Even in its current dumbed-down state, Times Square still offers the world’s brightest lights and unparalleled mass-transit access. Its great office buildings are a short walk to Bryant Park and to the shopping and cultural attractions of the rest of Midtown.

But the Elmos have taken their toll. Although Condé Nast’s move to One World Trade Center was attributed to favorable lease terms in an “iconic” new skyscraper, it took more than that to persuade the media company to quit its historic West Midtown home.

Former GQ Editor-in-Chief Jim Nelson gave the game away in 2016, when he said that the streets around 4 Times Square had become a “clown circus” that he couldn’t leave “fast enough.”

City Hall realized it had spawned a lemon. Under pressure from business owners and landlords, it corralled the Elmos into specific spots. It spent a mind-boggling $55 million — $55 million! — to spiff up the original schoolyard-like plazas with a two-tone concrete pattern by Snøhetta design.

‘City Hall’s clumsy attempt to fix a Times Square that wasn’t broken cost the great landmark its soul — and perhaps its commercial viability as well’

Yet the office market shows signs of more trouble ahead. Real-estate firm Colliers International says that since the end of the Great Recession in 2010, average asking rents rebounded by 61 percent across town — but only by 20 percent in Times Square, the lowest increase for any Manhattan sub-market.

The current availability rate in the Bow Tie’s 14 office buildings with a total 11.5 million square feet is 9.4 percent, according to real-estate company CBRE. It was just 6.9 percent before Broadway was closed to vehicular traffic.

When E&Y moves from 5 Times Square to the far West 30s next year, it will add 900,000 square feet to Times Square office space in need of tenants and potentially hike area availability to a staggering 17.2 percent. Meanwhile, 1540 Broadway’s owners face having to fill another 278,000 square feet in May 2021.

Yes, old tenants can be replaced. The Durst Organization quickly filled most of Condé Nast’s floors with new occupants, and found others to take about one-third of Skadden’s. But luring them cost the landlord $150 million in upgrades to a building just 20 years old. Just as crucial: It exorcised “Times Square” from the building’s name and rechristened the tower One Five One West 42nd Street.

City Hall’s clumsy attempt to fix a Times Square that wasn’t broken cost the great landmark its soul — and perhaps its commercial viability as well. Only time will tell whether it’s too late to save.