The PglZ family of proteins belongs to the alkaline phosphatase superfamily, which consists of metallohydrolases with limited sequence identity but similar metal-coordination architectures in otherwise divergent active sites. Proteins with a well-defined PglZ domain are ubiquitous among prokaryotes as essential components of BREX phage defence systems and two-component systems (TCSs). Whereas other members of the alkaline phosphatase superfamily are well characterized, the activity, structure and biological function of PglZ family proteins remain unclear. We therefore investigated the structure and function of PorX, an orphan response regulator of the Porphyromonas gingivalis TCS containing a putative PglZ effector domain. The crystal structure of PorX revealed a canonical receiver domain, a helical bundle, and an unprecedented PglZ domain, similar to the general organization of the phylogenetically related BREX-PglZ proteins. The PglZ domain of PorX features an active site cleft suitable for large substrates. An extensive search for substrates revealed that PorX is a phosphodiesterase that acts on cyclic and linear oligonucleotides, including signalling molecules such as cyclic oligoadenylates. These results, combined with mutagenesis, biophysical and enzymatic analysis, suggest that PorX coordinates oligonucleotide signalling pathways and indirectly regulates gene expression to control the secretion of virulence factors.