Do airliner cabin filters trap viruses or other pathogens?
Modern airliners use HEPA filters to filter the air before re-circulation. This will remove almost all airborne pathogens like viruses:


  The overall risk of contracting a disease from an ill person onboard an airplane is similar to that in other confined
  areas with high occupant density, such as a bus, a subway, or movie theatre for a similar time of exposure.
  anywhere where a person is in close contact with others.
  
  That said, the risk on airplanes is probably lower than in many confined spaces because modern airplanes have
  cabin air filtration systems equipped with HEPA filters.
  
  HEPA or high efficiency particulate air filters have similar performance to those used to keep the air clean in
  hospital operating rooms and industrial clean rooms. These filters are very effective at trapping microscopic
  particles as small as bacteria and viruses. 
  
  [...]
  
  Air filters can remove very small particles such as bacteria and viruses. Virtually all viruses and bacteria are
  removed; even the most difficult particles in the range of 0.1 to 0.3 micron are filtered out with an efficiency level
  of of 99.995%. Contrary to popular belief, very small particles below 0.1 micron are easily filtered out by the
  mechanism of diffusional interception. 


(IATA Briefing Paper - Cabin air quality - Risk of
communicable diseases transmission, emphasis mine)

The following image shows the location of this filter in front of the re-circulation fan for a Boeing 737:


(Boeing 737 NG FCOMv2 2.30.5 Air Systems - Air Conditioning System Description)