Trump also said the larger question is not whether he knew about the payments, but whether the money came from the Trump campaign itself.
"You have to understand, Ainsley, what he did — and they weren't taken out of campaign finance," Trump said in an interview with Fox News host Ainsley Earhardt.
Trump added: "In fact, my first question when I heard about it was, 'Did they come out of the campaign?' because that could be a little dicey. And they didn't come out of the campaign, and that's big."
In July, it was revealed that Cohen made a secret recording of him talking to Trump about paying off Playboy model Karen McDougal to keep her quiet about her alleged affair with Trump.
White House press secretary Sarah Huckabee Sanders later referred questions about when the president knew about the payments to McDougal and porn star Stormy Daniels to his outside attorneys.
Cohen on Tuesday pleaded guilty to charges filed by federal prosecutors in Manhattan, including tax fraud and campaign finance violations.
Cohen's lawyer, former Clinton White House aide Lanny Davis, said Tuesday that Cohen testified under oath that "Donald Trump directed him to commit a crime by making payments to two women for the principal purpose of influencing an election."
"You look at President Obama, he had a massive campaign violation," Trump said. "But he had a different attorney general, and they viewed it a lot differently."
Trump referenced that fine in a tweet earlier Wednesday.
Politico reported in 2013 that Obama's 2008 presidential campaign was fined $375,000 by the Federal Election Committee.