Urban mining of precious metals from electronic waste, such as printed circuit boards (PCB), is not yet feasible because of the lengthy isolation process, health risks, and environmental impact. Although porous polymers are particularly effective toward the capture of metal contaminants, those with porphyrin linkers have not yet been considered for precious metal recovery, despite their potential. Here, we report a porous porphyrin polymer that captures precious metals quantitatively from PCB leachate even in the presence of 63 elements from the Periodic Table. The nanoporous polymer is synthesized in two steps from widely available monomers without the need for costly catalysts and can be scaled up without loss of activity. Through a reductive capture mechanism, gold is recovered with 10 times the theoretical limit, reaching a record 1.62 g/g. With 99% uptake taking place in the first 30 min, the metal adsorbed to the porous polymer can be desorbed rapidly and reused for repetitive batches. Density functional theory (DFT) calculations indicate that energetically favorable multinuclear-Au binding enhances adsorption as clusters, leading to rapid capture, while Pt capture remains predominantly at single porphyrin sites.