Rapid methods for diagnosis of bacterial infections are urgently needed to reduce inappropriate use of antibiotics, which contributes to antimicrobial resistance. In many rapid diagnostic methods, DNA oligonucleotide probes, attached to a surface, bind to specific nucleotide sequences in the DNA of a target pathogen. Typically, each probe binds to a single target sequence; i.e., target-probe binding is monovalent. Here we show using computer simulations that the detection sensitivity and specificity can be improved by designing probes that bind multivalently to the entire length of the pathogen genomic DNA, such that a given probe binds to multiple sites along the target DNA. Our results suggest that multivalent targeting of long pieces of genomic DNA can allow highly sensitive and selective binding of the target DNA, even if competing DNA in the sample also contains binding sites for the same probe sequences. Our results are robust to mild fragmentation of the bacterial genome. Our conclusions may also be relevant for DNA detection in other fields, such as disease diagnostics more broadly, environmental management, and food safety.