I had fixed the issue, but when I updated the theme, the file rank-math.php disappeared from the theme file FTP/file/themes/theme-name.
Any alternate solution?
Also, How can I check if my rank math is the latest version?
Hello,
Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.
We are glad that you have already managed to apply the fix.
If the rankmath.php file is getting removed upon updating your plugin, you can create a child theme or use the Code Snippets plugin and apply the filter there instead.
You can click the Check again button on your WordPress dashboard > Dashboard > Updates if the Rank Math plugin is not showing the latest update. For the latest version, you can visit our changelog link.
I hope that helps.
Thank you.
How to filter with Code Snippets?
Hello,
You can follow this guide to add the filter using the Code Snippets plugin:
https://rankmath.com/kb/wordpress-hooks-actions-filters/#code-snippets-plugin
Hope that helps.
Thank you.
I mean what is the code that I’ll add to set a filter for the rank-math.php file?
I do not know PHP, you’ll have to share the code.
It should prevent my theme and rank math plugin to delete the rank-math.php file upon update.
I use the code snippets plugin. Let me know what code shall I enter to apply the filter?
Hello,
You can use the Code Snippets plugin to add the PHP code. This will eliminate the need for using a rank-math.php
file in your theme.
Please follow these steps one by one to show keywords meta tags on your site.
1. Install Code Snippets plugin from here – https://wordpress.org/plugins/code-snippets/
2. Add a New Snippet.
3. Add this PHP Code in the snippet –
add_filter( 'rank_math/frontend/show_keywords', '__return_true');
4. Save and Activate the Snippet
This will add the keywords meta tags on your pages.
Let us know how it goes.
Looking forward to helping you on this one.
Thank you.
Using this code `add_filter( ‘rank_math/frontend/show_keywords’, ‘__return_true’);
in the code snippet plugin.
Can I delete rank-math.php now?
Hello,
Yes, you can delete the rank-math.php
file now.
Let us know if you have any other questions.
We are here to assist you.
Hello,
Glad that helped.
If you have any questions in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.