San Francisco’s long relationship with X is nearly over — and city officials are far from heartbroken.

Elon Musk is shuttering his social media company’s headquarters in a gritty downtown neighborhood in the coming weeks and will move its last employees based there south to offices in Palo Alto and San Jose. New headquarters will be set up in Texas.

But city officials are not lamenting the exit. X bears little resemblance to the company that San Francisco wooed with a tax break more than a decade ago, when it was Twitter, to help anchor a budding tech hub in a downtrodden neighborhood near City Hall known as Mid-Market. The pandemic, and Mr. Musk’s 2022 acquisition of the company and subsequent gutting of its work force, reduced the headquarters to a ghost town.

“I share the perspective that most San Franciscans have, which is good riddance,” said City Attorney David Chiu, who as a member of the city’s Board of Supervisors backed the tax break that lured Twitter to Mid-Market in 2012.

Twitter once symbolized San Francisco’s status as a start-up capital. But the city’s nonchalant response to the move — amid public posts from Mr. Musk about San Francisco’s inflexible tax policies and liberal politics — shows officials are now less willing to cater to companies considering a move.

Mr. Musk and X did not respond to requests for comment.

Twitter was founded in San Francisco in 2006. In 2011, it threatened to forsake its hometown for tiny Brisbane, just over the city’s southern border, which wouldn’t levy payroll taxes.