it stays on the pipe, bur once you have got the filter off you can easily get the retainer off the pipe just by pulling apart the open end a bit
to get the filter off just squeeze the retainer & if you get stuck just press a screwdriver against the retainer where it clips on