WASHINGTON—The House on Tuesday passed legislation extending a ban on guns that can't be spotted by a metal detector, but held back from expanding it to address all-plastic guns made possible by 3-D printer technology.

The bill, passed on a voice vote, would extend for 10 years a law dating back to 1988 that makes it illegal to manufacture, sell or possess a gun that could elude metal detectors, which are used for security screening at government buildings, schools and airports. Under the law, gun makers must include a...