Infections caused by pathogenic bacteria, especially multidrug-resistant bacteria, have become a serious worldwide public health problem. Early diagnosis and treatment can effectively prevent the adverse effects of such infections. Therefore, there is an urgent need to develop effective methods for the early detection, prevention, and treatment of diseases that are caused by bacterial infections. So far, magnetic material nanoparticles (MNPs) have been widely used in the detection and treatment of bacterial infections as detection agents and therapeutics. Therefore, this review describes the recent research on MNPs in bacterial detection and treatment. Finally, a brief discussion of challenges and perspectives in this field is provided, which is expected to guide the further development of MNPs for bacterial detection and treatment.