-
Hello
Thanks for a fine plugin.
I would like to report what seems to me to be a bug with the filter ‘rank_math/frontend/keywords’.When adding keywords via this filter they do not appear in the head meta tag.
The tag only shows the saved keywords from the postmeta field ‘rank_math_focus_keyword’.
<meta name=”keywords” content=”[only postmeta value no filtered keywords]”>Note that I have set add_filter(‘rank_math/frontend/show_keywords’, ‘__return_true’) and can see the meta keywords tag if the postmeta field has been set. So the meta tag does work.
Looking at the code in RankMath\Paper the get_keywords() function immediately returns the cached $this->keywords from the postmeta before it has set the filtered value.
Note also the code documentation says its expecting an array for $keywords. But it is a comma separated string.
/**
* Allows filtering of the meta keywords.
*
* @param array $keywords The meta keywords to be echoed.
*/
return $this->do_filter( ‘frontend/keywords’, $this->keywords );Cheers
Wayne David Harris
The ticket ‘Prospective bug with filter rank_math/frontend/keywords’ is closed to new replies.