In this letter we propose the search of dark photons in the decay of pions produced by $gamma gamma$ interactions in ultraperipheral $PbPb$ collisions. The cross section is estimated considering an accurate treatment for the absorptive corrections and for the nuclear form factor. Predictions for the event rates are presented considering the expected luminosities for the LHC, High -- Luminosity LHC and High -- Energy LHC as well as for the Future Circular Collider. Our results indicate that a future experimental analysis of the pion production in ultraperipheral heavy ion collisions can be useful to probe the dark photon production and constrain its properties.