Needham-based Tripadvisor slapped a hotel in Thailand with a custom-made warning label Wednesday after the resort reported a user to authorities for writing a negative review, leading to his jailing.

The message at the top of the hotel listing on the travel platform says “this hotel or individuals associated with this hotel filed criminal charges against a Tripadvisor user in relation to the traveler writing and posting online reviews. The reviewer spent time in jail as a result.’’

“It’s a day where employees feel proud to work for a company that really stands up for its travelers,’’ Tripadvisor spokesman Brian Hoyt said.

The action stems from an incident during the summer when Wesley Barnes, a guest at the Sea View Resort & Spa in Koh Chang, posted a review on Tripadvisor claiming the hotel had an “unfriendly staff and horrible restaurant manager.’’ Sea View asked Tripadvisor to take down the review, and when it wasn’t, it took legal action: Barnes was arrested on criminal charges, said Brad Young, vice president and associate general counsel for Tripadvisor. Thailand is known for its tough laws restricting free speech, which are partly aimed at preventing criticism of businesses.

“[The hotel] didn’t like the way he described his experience and took rather draconian measures in retaliation," Young said.

Young said lawsuits involving Tripadvisor are typically civil actions, dealing with claims of defamation or attempts to silence criticism online.

“This situation was a whole new level,’’ he said.

Tripadvisor learned of Barnes’s situation on Sept. 26 and connected with him three days later, offering to pay his legal fees. The company spent the next week negotiating with the hotel, government officials in Thailand, and the US embassy there, hoping to set up a meeting between Barnes and Sea View officials. The two parties agreed to meet on Oct. 1, and about a week later they reached an agreement that resulted in the charges being dropped.

The settlement, however, included terms for Tripadvisor, even though the company was not a part of the discussions. It required Barnes to get a letter from Tripadvisor stating that it would not put a red badge on the hotel listing page. (Red badges are typically used to flag businesses that reward guests in return for positive reviews or intimidate them if they post unfavorable ones.)

Young said the hotel was essentially seeking to “stop providing information to travelers. That is what Tripadvisor does.’’

But after weeks of trying to negotiate with the hotel to drop the red badge clause from the settlement, Tripadvisor sent a letter to Barnes on Oct. 27, confirming that it would not label Sea View with a red badge. Barnes was soon released from jail and given back his passport.

Although Tripadvisor adhered to its promise not punish the hotel with a red badge, employees were busy creating a new feature that would still uphold their firm stance on free speech: An orange warning.

Young said Tripadvisor’s business model depends on users being able to post honest reviews, something it calls the “right to write.’’

“It only works if you enable people to share the good and the bad,’’ he said.

Once Tripadvisor learned Barnes was no longer in Thailand, it published the new warning message above Sea View’s hotel listing.

Young said the company had not heard directly from the hotel as of Wednesday afternoon, but Sea View told the New York Times in a statement that it does not understand “how Tripadvisor going back on their word, and not being impartial, is helpful to any of the parties involved in this case.’’

Young said Tripadvisor did not breach the terms of its letter since it did not label Sea View with a red badge, and was not even a party to the settlement with Barnes.

Anissa Gardizy can be reached at anissa.gardizy@globe.com. Follow her on Twitter @anissagardizy8.