Starbucks will start blocking pornography viewing on its stores' Wi-Fi starting in 2019, the company announced amid renewed public pressure on the coffee giant by an internet-safety group.

A Starbucks representative told NBC News that the viewing of "egregious content" over its stores' Wi-Fi has always violated its policy, but the company now has a way to stop it.

"We have identified a solution to prevent this content from being viewed within our stores and we will begin introducing it to our U.S. locations in 2019," the company representative said.

The announcement was first reported by Business Insider and comes after a petition from internet-safety advocacy group Enough is Enough garnered more than 26,000 signatures.

The nonprofit launched a porn-free campaign aimed at McDonald's and Starbucks in 2014, and it says that while McDonald's "responded rapidly and positively," Starbucks did not.

Starbucks said in 2016 that the company was "in active discussions with organizations on implementing the right, broad-based solution that would remove any illegal and other egregious content," according to a statement Monday by Enough is Enough CEO Donna Rice Hughes. But they didn't act, she said.

"Starbucks has had a tremendous opportunity to put its best foot forward in protecting its customers from images deemed obscene and illegal under the law, but they haven't budged, despite their promise two years ago and despite the fact that they voluntarily filter this same content in the UK," Hughes said in the statement.

Hughes told NBC News on Thursday that Enough is Enough ran a thank you campaign for Starbucks in 2016, but this time the organization will take a different tack.

"They won’t get an applause until they’ve actually implemented safe Wi-Fi filtering," Hughes said. "This time we’re going to wait and see, and we’re going to keep the pressure on."

In a letter that Hughes said she received from Starbucks over the summer, the company vowed to address the issue "once we determine that our customers can access our free WiFi in a way that also doesn't involuntarily block unintended content."

Starbucks has not released details about how it plans to restrict the viewing of pornographic sites or illegal content over its Wi-Fi.

The vice president of YouPorn, a free pornographic video-sharing site and one of the 200 most-visited websites worldwide, responded by sending a memo to staff banning Starbucks products from company offices starting Jan. 1, 2019.