WASHINGTON — At his convention speech last month, former President Donald Trump declared that his new economic agenda would be built around a plan to eliminate taxes on tips, claiming that the idea would uplift the middle class and provide relief to hospitality workers around the country.

“Everybody loves it,” Trump said to cheers. “Waitresses and caddies and drivers.”

While the cost and feasibility of the idea has been questioned by economists and tax analysts, labor experts have noted another irony: As president, Trump tried to take tips away from workers and give the money to their employers.

The reversal is one of many that Trump has made in his bid to return to the presidency and underscores his high malleability in election-year policymaking. From TikTok to cryptocurrencies, Trump has been reinventing his platform on the fly as he aims to attract different swaths of voters. At times, Trump appears to be staking out new positions to differentiate himself from Vice President Kamala Harris or, perhaps, just to please crowds.

To close observers of the machinations of Trump’s first term, the shift on tips, a policy that has become a regular part of his stump speech, has been particularly striking.

“Trump is posing as a champion of tipped restaurant workers with his no-tax-on-tips proposal, but his actual record has been to slash protections for tipped workers at a time when they were struggling with a high cost of living,” said Paul Sonn, director of National Employment Law Project Action, which promotes workers’ rights.

In 2017, Trump’s Labor Department proposed changing federal regulations to allow employers to collect tips that their workers receive and use them for essentially any purpose as long as the workers were paid at least the federal minimum wage of $7.25 an hour. In theory, the flexibility would make it possible for restaurant owners to ensure that cooks and dishwashers received part of a pool of tip money, but in practice employers could pocket the tips and spend them at their discretion.

The Economic Policy Institute, a left-leaning think tank, said at the time that the policy could cost tipped workers $5.8 billion a year.

After months of backlash from advocacy groups, lawmakers inserted language into a 2018 federal spending bill to make clear that employers cannot keep any portion of tips earned by their workers.

Tips are not the only issue that Trump has changed his mind about since leaving office.

Amid growing tension with China in 2020, Trump issued an order barring TikTok from U.S. app stores unless the company, which is owned by Byte Dance in China, could resolve concerns that it was a threat to national security. A federal judge granted TikTok a reprieve that year, allowing the popular social media platform to keep operating in the United States. This year, the Biden administration has been trying to force the sale of TikTok, after passage of legislation that would require it to find a new owner.

But now that TikTok is on the brink in America, Trump is a booster of the platform.

“Trump is going to keep TikTok going, whereas Biden-Harris, they have no idea what it means,” Trump told internet celebrity Adin Ross last week, suggesting that a ban would somehow be good for China.

Making clear that the policy is an election gambit, he said: “So all of the people on TikTok, vote for Trump.”

Lobbying also appears to be a factor.

Veterans of the Trump administration have been working to help Jeff Yass, the billionaire Republican donor and TikTok investor, prevent the app from being banned.

Then there is bitcoin.

In summer 2019, Trump assailed digital currencies in a series of posts on social media and warned that they can facilitate the sale of drugs and other illegal activity.

But many of Trump’s former administration officials went on to work for or lobby on behalf of the cryptocurrency industry.

And as a candidate this year, Trump began taking in millions of dollars of cryptocurrency donations and allowing supporters to buy Trump-branded sneakers with bitcoin. The Republican Party platform even included a pledge to “defend the right to mine bitcoin.”

During a bitcoin conference last month in Nashville, Tennessee, Trump said he wanted the United States to be the “crypto capital of the planet” and the bitcoin “superpower of the world.” He criticized the Biden administration, accusing the government of stifling the industry, and promised to let it flourish if he were elected again.

The Trump campaign said Trump was making policy decisions based on what he thinks is best for the American people.

Policy changes are not unusual in political campaigns, and Trump is not alone in shifting his views.

Harris called for a ban on fracking in 2019. But last month her campaign told Politico that she would not try to ban the technology used for extracting oil and gas in such states as Pennsylvania, a key electoral battleground.