A Walmart store in Chicago, in November 2018. (Kamil Krzaczynski/Reuters)

Walmart is shuttering four stores in Chicago, halving its locations in one of the nation’s largest cities and adding to a growing list of closures in urban areas.

So far this year, the nation’s largest retailer has closed locations in D.C., Portland and Atlanta, signaling a retreat from its strategy to attract new customers outside the suburbs and small towns.

Walmart attributed the closures in Chicago to a lack of profitability — the stores there have collectively lost money every year since the first one opened 17 years ago.

The stores being closed “lose tens of millions of dollars a year, and their annual losses nearly doubled in just the last five years,” the company said in a news release. “The remaining four Chicago stores continue to face the same business difficulties, but we think this decision gives us the best chance to help keep them open and serving the community.”

Walmart warned of some possible belt-tightening this year in its February earnings call. Despite a strong holiday season, executives offered a muted outlook for the next quarter, and they’re not alone: Home Depot offered a similar narrative. The retailers noted that shoppers are feeling the strain of inflation and continuing to cut discretionary spending from their budgets. Overall retail sales dipped 0.4 percent last month and though government data shows inflation has moderated in recent months — prices rose 5 percent in March — costs remain at historic highs.

Both companies are seen as bellwethers for consumer behavior, making it unsurprising that several major retailers are cautious about 2023. Whole Foods closed its flagship store in downtown San Francisco.

Retailers are assessing performance on a store-by-store basis to see which ones are profitable and gauge their growth prospects, said Neil Saunders, the managing director of the analytics company GlobalData. He expects this to continue through the rest of the year.

“I think the general message is that in this very tight environment, we can no longer carry dead wood and we have to chuck it overboard,” Saunders added.

The news of closures in the south and west sides of Chicago brought swift outcry from city leaders. Mayor Lori Lightfoot said she is “incredibly disappointed” by Walmart’s decision.

“Unceremoniously abandoning these neighborhoods will create barriers to basic needs for thousands of residents,” Lightfoot said in a statement to The Washington Post.

In its news release, Walmart said employees at the stores closing will be eligible to transfer to other locations or Sam’s Club facilities. The company will also “continue working with local organizations, creating solutions to challenges faced by the city and country, including racial inequity and food deserts.”

Walmart has a history of being reluctant to expand into urban areas. In 2016, the retailer backed out of a deal to open stores in some of Washington’s poorest neighborhoods.

Of the four stores closing their doors in Chicago, one is a Supercenter and three are Neighborhood Markets, which are mainly groceries. Saunders said these stores have never performed as well as the traditional format and are particularly weak in urban areas.

As a low-margin business, Walmart relies on customers making big shopping trips.

“Where Walmart works best is really in the suburbs,” Saunders said. “It’s where they can have a massive store, they can have massive parking lots, people can drive up to the store, they can load up the car.”

In urban areas, many people don’t have cars and therefore are limited with how much they can take home, Saunders said. Those who do drive to Walmart in cities may be deterred by small parking lots, he said.

Target, however, has performed better than its competitor in urban areas. Its higher-margin model leaves room for smaller shopping trips, Saunders said, adding that a scaled-down version of a Target has the same feel as a regular-sized store.

“I think it’s much more successful in urban areas because Target is much more of an inspiration-type shop, especially in urban areas,” he added. “It’s the type of store where people will go in there, they will buy some beauty, they might buy some apparel, they might buy some essentials and do a little bit of a top up shop. And those things are generally much easier to carry.”