A state judge threw out a portion of a Seattle ordinance requiring garbage collectors to snoop through residents’ trash in search of food waste, calling the provision unconstitutional.

King County Superior Court Judge Beth M. Andrus issued an injunction against the garbage inspections but not Seattle’s residential food-waste ban, which forbids throwing away food scraps and compostable paper.

“This ruling does not prohibit the city from banning food waste and compostable paper in SPU-provided garbage cans,” the 14-page decision said, referring to the Seattle Public Utilities. “It merely renders invalid the provisions of the ordinance and rule that authorize a warrantless search of residents’ garbage cans when there is no applicable exception to the warrant requirement, such as the existence of prohibited items in plain view.”