NO BUG: Rank math Dynamic tag is not rendered in Bricks variables

trying to output the Rankmath title in the page using the custom codes in Bricks which is {cf_rank_math_title}, problem is that if you are using dynamic tags like the page title in the Rankmath titles they are not pre-rendered, they output like “This is my title: %title%” in bricks. Maybe this is something you can fix? I spoke to Rankmath and they say it isn’t their issue but they did mention using this function “RankMath\Helper::replace_vars(”%title%“);”

Hi @SpinDreams,

I will mark this as a no-bug, because when you use native custom fields (cf_ prefix), you get it as they are.

To use this function, you can use custom code field and set it something like that. And don’t forget to turn on “Parse dynamic data”.

<?php 
echo RankMath\Helper::replace_vars('{cf_rank_math_title}');
?>

Or you can create a custom function, to which you pass a parameter and then you use {echo:custom_rm_title('{cf_rank_math_title}')} echo tag like this. And in the function, you can call that RankMarh function.

But overall, you will need to do this manually.

I hope that helps :slight_smile:

Best regards,
M

1 Like