President Trump at one point devised a plan to buy decades’ worth of unflattering stories the National Enquirer had collected about him but never published, according to a new report.

Under the plan, which was never completed, Trump and his then-attorney, Michael Cohen, sought to buy all the dirt that the Enquirer and its parent company, American Media Inc., had amassed on him since the 1980s, several of the president’s associates told The New York Times.

The supermarket tabloid had bought the stories under a practice known as “catch and kill” – paying people for the rights to their potentially embarrassing tales about Trump and keeping the sordid accusations under wraps.

Among the unflattering stories were tips about Trump’s marital woes, alleged affairs and dishonest golfing, people with knowledge of AMI’s operations told the newspaper on condition of anonymity.

Some of the stories were reportedly kept in a safe but it was unclear whether the information still exists after it was moved to another location around the time of Trump’s inauguration, according to The Associated Press.

The existence of the plan to buy the material has not been previously reported, but it was hinted at in a recording that Cohen’s attorney, Lanny Davis, released about a conversation his client had with Trump.

“It’s all the stuff — all the stuff, because you never know,” Cohen said on the secret recording in which the president appears to discuss a possible payment to buy the rights to Playboy model Karen McDougal’s affair claim.

It remained unclear whether the proposed plan to buy the stories has attracted the interest of the feds in New York, where Cohen last week pleaded guilty over a $130,000 payment to porn vixen Stormy Daniels as well as a $150,000 payment to McDougal, the paper reported.

Prosecutors have granted immunity to two AMI honchos so they can spill their guts about the roles Trump and Cohen played in the hush-money payments during the 2016 presidential campaign.

In exchange for their cooperation, AMI CEO David Pecker and Dylan Howard, the company’s chief content officer, won’t face prosecution for their roles in the payoffs, according to The Wall Street Journal.

Pecker, a longtime pal of the president’s, has already met with prosecutors and shared details about the payments that Cohen arranged to silence McDougal and Daniels.

In 2016, Pecker prevented his staff from sifting through Trump materials that dated to before Pecker became AMI chairman in 1999, several former staff members told the paper.

Shortly after AMI completed the $150,000 deal with McDougal at Trump’s behest, the president and Cohen became worried about what would happen to AMI’s sensitive Trump files if Pecker were to leave the company, sources told The Times.

Cohen heard rumors that Pecker might jump ship for Time magazine, according to the sources.

“Maybe he gets hit by a truck,” Trump said of Pecker in a conversation with Cohen, contemplating about an unfortunate demise to his good pal.

Lawyers for Trump and Cohen declined to comment to the Times, as did AMI.