US President Donald Trump's website features a hidden piece of code intended to throw shade at his predecessor Barack Obama in the event of a technical error. Washington Post reporter Christopher Ingraham first noticed that the website, which is paid for by the GOP, was coded to display a snarky error message to replace the basic "page not found" message in case of a broken link.

"Oops! Something went wrong. Unlike Obama, we are working to fix the problem... and not on the golf course," the error message reads.

Ingraham said he found the same code on the website, on the GOP website's homepage and a number of other official GOP sites. However, it noted that it is unclear whether the error message was ever shown.

A data expert reportedly said that the code itself is broken and will never actually display the message since it uses just a single equal sign when there should be two.

The 404 error message code also included a jab at Hillary Clinton to display a message that reads: "What do Hillary Clinton and this link have in common? They're both dead broke."

The code for the golf error message was removed from the websites just a few hours after it was discovered, Ingraham tweeted.

"That suggests that someone at either RNC or the Trump admin is sensitive enough to Trump's golf problem to make this issue go away quickly once people noticed. You have no idea how much I'd love to see the email exchange that led us here," Ingraham wrote. "What a time to be alive."

The revelation comes as Trump spends his winter holidays at his Mar-a-Lago golf resort and was spotted golfing two days in a row just hours after tweeting he'd "get back to work" after Christmas.

Both during and prior to the 2016 election campaign, Trump has frequently criticised Obama for golfing during his presidency. During campaign rallies, he said he would have no time to golf as president and even promised to largely give up the sport altogether.

However, in his first year as president, he has spent 114 days of 344 days in office at a Trump property, and another 88 days visiting one of his golf properties, according to a running tally by NBC News. In comparison, Obama played 333 games of golf over his eight years in office.

The White House has defended Trump's golfing habits as efforts to build relationships with lawmakers and other leaders.

The 404 error message on Trump's website currently reads: "Don't worry, we're making it great again."

1 of 2