Jared Kushner told a software developer who worked at his newspaper, the New York Observer, to delete several "critical" stories in 2012, according to Austin Smith, the developer who said he "complied."

Smith now has regrets about his involvement.

Kushner was seeking to erase Observer stories that were "critical of his commercial real estate colleagues," Smith said in a Hacker News message board post.

Back then, Kushner was the publisher of the Observer. Now he is a senior adviser to President Donald Trump.

Smith said he was inspired to speak out by a recent Hacker News discussion about unethical behavior, plus the president's usage of extreme "enemy of the people" rhetoric to attack journalists.

"I didn't know any better then, but I do now," Smith said in a series of tweets on Monday.

I didn't know any better then, but I do now, which is why I brought it up in the HN thread about unethical developer behavior. https://t.co/V8JH36HYpP — Austin Smith (@netaustin) August 6, 2018

He said he is sorry for deleting stories by Observer staff members.

BuzzFeed highlighted the deletions on Monday. A "handful of articles" were affected. The White House press office did not respond to requests for comment.

According to emails seen by BuzzFeed's Steven Perlberg, Kushner went around the paper's editors "to mandate the removal of a handful of articles from the website."

BuzzFeed noted that "the secret removal of stories due to outside pressure is widely regarded as an unethical practice in journalism."

The editor at the time, Elizabeth Spiers, said on Twitter that she found out about this action "a few months ago." Her reaction: "I don't have enough choice expletives describe my feelings about that."

I found out a few months ago that while I was the editor in chief of the Observer, Jared was instructing our third party tech provider to delete articles critical of his business associates w/out my knowledge. I don't have enough choice expletives describe my feelings about that. https://t.co/EYyEn0YIKI — Elizabeth Spiers (@espiers) August 6, 2018

How could Kushner pull this off without the newsroom knowing?

"When you publish some 50 odd stories a week, you don't notice two or three missing here and there weeks after fact," Spiers told CNNMoney.

"We also had a couple of site redesigns and site search was abysmal," she added. "So if you didn't immediately find something in search there were more likely (at the time) explanations."

Spiers has been critical of Kushner and other Trump White House officials.

Kushner resigned from the Observer when he joined the Trump administration in January 2017. He transferred the paper into a family trust.