In the last year or two there's a great new version of Saran Wrap that's got a "press and seal" sticky side. Blanket the air-box while stretching it into place. For added protection use a bungee cord or large rubber band around the outer edges. Works flawlessly.
As for exposed filters without air-boxes as in the second picture by THUMP RRR, we take them off then using the same "press & stick" wrap we'll seal off the exposed air duct connection.
Depending on the air intake set-up, we'll remove the plastic duct-work from the air-filter to the intake (only if there's no wiring attached) as it opens up the engine bay for a more thorough cleaning. Of course, sealing the intake as described above.
NOTE: I just ran down into the garage to find the exact brand that I like - I've been through a lot of them and the one that has not let me down is "GLAD - Press & Seal".
I use this product in door jams that are difficult to clean after a multi-step process that will spatter product where you can see it, but will be hard to clean (can anyone say 90's Cadillac

) I also use it on and in exterior ducts and vents for the same reason and it follows contours better than any tape, and has enough mass to press deep into the ducts and vents for added protection against product spatter. I'm sure you'll invent your own uses too.
Hope this helps.