Nowadays, water pollution due to heavy metal ions is a great concern in all human communities. In this project, a metal-organic frameworks (MOFs), which were named Zn2(oba)2bpy, (1; H2oba = 4,4-oxybisbenzoic acid and bpy = 4,4-bipyridine) linkers, were successfully synthesized. The properties of these MOFs were investigated using different techniques, such as FT-IR, XRD, and SEM analysis. The frameworks have special characteristics, like the rapid, efficient, and selective removal of metal ions from contaminated water. The use of an ultrasonic device plays an important role in shortening the absorption time of mercury (II) ions by increasing absorbent dispersion in the solution. The adsorption capacity was affected by variables such as the pH of the solution, Hg2+ initial concentration, adsorbent dosage, and contact time. For Hg(II) metal ions, the sorption capacity of 338 mgg−1 was effectively obtained by Zn2(oba)2bpy structures. The experimental adsorption data for the Zn2(oba)2bpy MOF is well-suited to the pseudo-second-order kinetic model (R2 = 0.99), and the adsorption isotherms of Hg2+ metal ions are in good agreement with the Langmuir model. This work displays the effective removal of Hg2+ ions from pollutant water in under 30 min. The antibacterial activities of Zn2(oba)2bpy (1) were tested against gram-positive and gram-negative species. The as-synthesized 1 exhibited excellent antibacterial effectiveness against Escherichia coli and Staphylococcus aureus.