US President Donald Trump attacked the New York Times after publishing an article without mentioning the author's name, talking about attempts within the administration to stop his reckless rush.

The article said that Trump's "immoral behavior" and "behavior involving repeated cracks" and making "ill-considered, sometimes ignorant and sometimes reckless" decisions resulted in a "dual-track presidency".

"The problem that Trump can not fully understand is that many senior officials in his administration are working diligently from within to frustrate parts of his agenda and his worst tendencies," the newspaper quoted a senior official as saying.

The official described the president's leadership style as "reckless, provocative, trivial and ineffective."

Trump responded to the article as "meaningless and truly shameful" and published a tweet in which he commented in one word "betrayal" in a reference to the article.

He then published another tweet asking whether the senior government official who wrote the article was already present or whether it was fabricated by the newspaper, calling for his extradition to the authorities on grounds of national security, if any.

Trump pointed out that the newspaper had to apologize to its readers because it covered the election wrongly, and now publishes an opinion piece by an anonymous writer in a cowardly move, as he put it.

"He is doing a good job and no one will be able to defeat him in the 2020 elections because of what he has accomplished," he says.

White House spokeswoman Sarah Sanders said the administration was "frustrated" by the newspaper's decision to publish an article "pathetic, arrogant and selfish."

Sanders added that the writer "himself and his arrogance above the will of the American people" calling "cowardly" to do the right and resign.

The newspaper said it had blocked the writer's name for fear that it would threaten her work.