Hello,
Below is an example that creates the shortcode [rm_title] for the title. You would need to create similar custom functions for other variables:
add_shortcode('rm_title', 'rm_shortcode_title');
function rm_shortcode_title(){
$obj = get_queried_object();
if(is_single()){
$title =get_post_meta($obj->ID, 'rank_math_title', true);
return RankMath\Helper::replace_vars($title);
}
if(is_tax()){
$title = get_term_meta($obj->term_id, 'rank_math_title', true);
return RankMath\Helper::replace_vars($title);
}
}