The present invention relates to an in situ cleanable filter for an ostomy appliance comprising a pathway for leading gases to a vent in an ostomy bag and a protective element contained in said pathway to prevent solid or semi-liquid waste from blocking the pathway where a channel or compartment formed by liquid impermeable layer(s) is defining at least part of the pathway and at least a part of said compartment or channel contain a protective element of an open celled compressible material having a memory and having a pore size of at least 60 PPI, said protective element extending in the same direction as the gas flow within the channel or compartment, said channel or compartment having an opening providing access to the pathway from the interior of the bag, said pathway having another opening being connected to a vent in the ostomy bag, optionally via a deodorizing filter.The invention relates to an ostomy appliance comprising a filter as above and a method for emptying and cleaning the filter.