President Trump has sought repeatedly to punish journalists for the way they ask him questions, directing White House staff to ban those reporters from covering official events or to revoke their press credentials, according to several current and former administration officials.

At various moments throughout his presidency, Trump has vented angrily to aides about what he considers disrespectful behavior and impertinent questions from reporters in the Oval Office and in other venues. He has also asked that retaliatory action be taken against them.

“These people shouting questions are the worst,” Trump has said, according to a current official. “Why do we have them in here?”

Until this week, the officials said, Trump’s senior aides have resisted carrying out his directives. They convinced him that moves to restrict media access could backfire and further strain the White House’s fraught relationship with the press corps, whose members the president routinely derides as “fake news” and “dishonest people.”