-
Hello,
is it possible to have a shortcode be rendered in Rank Math post preview?I have the classic [year] shortcode defined and working as a PHP snippet to dynamically display the current year in the post title.
add_shortcode('year', function() { return date('Y'); } ); add_filter('the_title', 'apply_shortcodes'); // apply to WP title add_filter('rank_math/frontend/title', 'apply_shortcodes'); // apply to Rank Math meta title
It is working as it should on the frontend for both the WordPress title and SEO title (I checked inspecting the page).
However, it is not displaying correctly in Rank Math post preview. I still see for example “Blablabla [year]”.
Is there a way to make it work in the post preview too? It would be very helpful for example to correctly count the number of characters and have the actual preview.
BTW, it works on the WordPress console post list, so I guess there should be a way to make it work on the Rank Math “backend” too.Thanks,
Fabio
You must be logged in to reply to this ticket.