Less than a week ahead of the legalization of adult recreational marijuana sales in Canada, Facebook Inc. will end a months-long block on cannabis and related search results for pages on its platform, the company told MarketWatch ahead of the change Thursday.

Marijuana-related search results for categories such as posts, pages and events were filtered by Facebook FB, +0.20% within the past year because people had been using the platform to sell pot in violation of its policies, according to a spokeswoman. As of Thursday, Facebook members around the world will be able to find cannabis-related pages that carry the company’s “gray” and “blue” verification symbols via search terms such as “marijuana.”

“We are constantly working to improve our search results so that we minimize the opportunity for people to attempt illicit drug sales while showing content that is allowed on Facebook and is relevant to what you are searching,” Facebook spokeswoman Sarah Pollack said in an emailed statement to MarketWatch. “When searching ‘cannabis’ or ‘marijuana,’ Pages that have been verified for authenticity will now be included in search results.”

Before Thursday, users were not, for example, able to find Facebook pages for Canadian government entities such as the Ontario Cannabis Store — the online shop run by the government of Ontario, Canada’s post populous province — via a search on the site, according to tests run by MarketWatch in the U.S. and Canada. Nor were Facebook members able to locate state government pages such as the California Bureau of Cannabis Control. U.S.-based advocacy and industry groups, such as the Marijuana Policy Project and the National Cannabis Industry Association, a federal lobbying group, were similarly invisible via cannabis-related terms within Facebook search.

Nongovernment organizations were affected as well, and wouldn’t show up in results — depending on the name of the group. It was possible to locate the Marijuana Policy Project via the term “MPP” but not via the search term “Marijuana Policy Project.”

The alterations to Facebook’s pot search results arrive as more countries around the world legalize medical cannabis, and eye recreational use for adults. In 2014, there were four countries looking into legal cannabis frameworks, a number that has risen to more than 25 in 2018. Several U.S. states such as California, Colorado and Washington have legalized recreational pot use for adults, and many more have passed medical marijuana legislation. Cannabis is prohibited under U.S. federal law.

“It’s about time that Facebook caught up with the majority of Americans who think that marijuana should be treated like a legal product,” said Mason Tvert, a spokesman for the nonprofit advocacy group Marijuana Policy Project. “A growing majority of Americans think that marijuana should be legal, and a growing number of countries and states are making it legal. I think it’s a great development and a wise move by Facebook as it’s trying to reconnect with the online community that it has turned off in so many ways.”

The alterations Facebook made to its search will not affect some results for cannabis-related queries, such as videos that currently return some results.

“Hopefully this is the beginning of a broader evolution on this subject and hopefully they will be starting to treat marijuana like other content,” Tvert said.

The company said the changes announced Thursday are part of a continuing effort to enforce policies on the platform, and the cannabis-related alterations are one new tactic — albeit a significant one — that the company has implemented. As the company rolls out this pot-related change to its search algorithm, the company said it intends to continue experimenting with different enforcement methods, including its altered approach to marijuana searches.

Facebook designed its gray verification for businesses and organizations not eligible for the blue verification reserved for public figures, media companies and brands. At the moment, marijuana resides in a policy category along with other drugs such as nonmedical pharmaceuticals, which the social network does not allow to be bought, sold or traded on its platform. Users typically found these banned activities via search, which is why the company makes them more difficult to find — content related to other illicit drugs will remain filtered from search results.

To receive a gray check mark, a business is required to give Facebook a publicly listed phone number of an organization and then enter a four-digit verification code into an automated call from the company, among other requirements. Facebook said it plans to communicate the changes through its relationships with page administrators and advertisers, among other means.