Tried to follow an article about meta keyword and found this error

#341771
  • Resolved DII
    Rank Math free

    I was trying the Rank Math guide to add meta keywords to my website. I added the rank-math.php file and inserted the snipet.

    1.

    Now, the theme, plugins update show an error.

    This is from one of my article source code, the meta name meant to show the keywords, but it is showing the word “focus keyword”
    https://ibb.co/h91PRcS

    2. Also, when I update the theme and plugin, it shows this error.
    https://ibb.co/1T5zK4H

    3. This part is visible on my website on top of the header bar…
    https://ibb.co/mHN4fmQ

    Find my website…

Viewing 11 replies - 1 through 11 (of 11 total)
  • DII
    Rank Math free

    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.

    Updates

    I hope that helps.

    Thank you.

    DII
    Rank Math free

    How to filter with Code Snippets?

    Anas
    Rank Math business

    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.

    DII
    Rank Math free

    I mean what is the code that I’ll add to set a filter for the rank-math.php file?

    DII
    Rank Math free

    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.

    DII
    Rank Math free

    Using this code `add_filter( ‘rank_math/frontend/show_keywords’, ‘__return_true’);
    in the code snippet plugin.

    Can I delete rank-math.php now?

    Anas
    Rank Math business

    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.

    DII
    Rank Math free

    Worked, Thanks!

    Anas
    Rank Math business

    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.

Viewing 11 replies - 1 through 11 (of 11 total)

The ticket ‘Tried to follow an article about meta keyword and found this error’ is closed to new replies.