A novel modified RANKL variant can prevent osteoporosis by acting as a vaccine and an inhibitor. Here, TNFSF11 is linked to osteoporosis.