Mg participates in the pathogenesis of osteoporosis by affecting the regulation of parathyroid hormone and vitamin D levels to affect the RANK/RANKL/OPG axis. Here, TNFRSF11B is linked to osteoporosis.