setting up automatic focus keywords in pages and products.

#754912
  • Resolved Kamran Ali
    Rank Math free

    I have incorporated all the code from the link you provided into my website’s functions.php file. However, every time I do this, my website’s functions.php gets removed, and I cannot see the rankmath.php on my website.

    Could you please manually set it up for me? My theme is ASTRA, and the website’s name is AffiliaBazaar, focusing on auto affiliate marketing.
    Your assistance is highly appreciated.

Viewing 15 replies - 1 through 15 (of 16 total)
  • Hello,

    I’m sorry to hear about the issue you’re facing with setting up automatic focus keywords on your website. I understand that you’ve tried adding the code to your website’s functions.php file, but it seems to get removed, and you can’t locate the rankmath.php file.

    To assist you further and manually set it up for you, I recommend assigning this ticket to a human agent by clicking on the available buttons so that they can provide you with personalized assistance based on your theme and website setup.

    Thank you for bringing this to our attention, and we’ll ensure your concern is addressed promptly.

    If you have any more details or questions, feel free to share them here.

    Best regards.

    Sources:
    How to Automate the Insertion of Focus Keyword » Rank Math
    Is There a Way to Use ACF for Focus Keywords? » Rank Math

    Hello,

    If you have put the code to your theme’s functions.php file, then it will be removed once your theme is updated to its latest version.

    However, you can use the Code Snippets plugin in that case so the code won’t get removed.

    Here’s a guide you can follow:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/#code-snippets-plugin

    Hope that helps.

    As you mentioned, I have followed the instructions to install the plugin and added the provided code in the functions.php file. However, upon checking, it appears that the focus key has not been added yet.

    Hello,

    In this case, we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.

    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    The website’s temporary admin login URL you’ve shared has expired and it is redirecting to your homepage.

    Please try to update the logins in the sensitive data section so that we can check the issue further for you.

    Looking forward to helping you.

    Thank you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    We’ve tried to check your website but were unable to go through the process due to the limited access to the account you’ve shared with us.

    Please provide admin-level access so that we can check the issue further for you.

    Looking forward to helping you.

    Thank you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    After checking your website, we can see you’re currently using the AIO SEO plugin on your website also there is no filter code added to your theme’s functions.php file.

    Could you please try to install the Rank Math SEO plugin again on your website and add the filter code so that we can check this further?

    Looking forward to helping you.

    Thank you.

    You’ve mentioned it, so I’ve reinstalled Rank Math as you suggested. and please tell me which one is filter code, abd where to mention

    Hello,

    You have mentioned that you already have a code provided to you as per your message here.

    Can you please confirm if you need a new filter code to automate the insertion of focus keywords? If so, you can get that code from here: https://rankmath.com/kb/how-to-automate-the-insertion-of-focus-keyword/

    To add the code, you can refer to this guide: https://rankmath.com/kb/wordpress-hooks-actions-filters/#code-snippets-plugin

    Looking forward to helping you.

    Dear Sir,I hope this message finds you well. I would like to bring to your attention that I currently have only included the focus keyword in the tags of the product, but it is essential for me to only product title. Your support in implementing this adjustment would be greatly appreciated.

    Hello,

    You can use the following filter to add product title as the focus keyword of the products:

    /**
     * Function to automatically update the focus keyword with the post title
     */
    function update_focus_keywords()
    {
        $posts = get_posts(array(
            'posts_per_page'    => -1,
            'post_type'        => 'product' //replace post with the name of your post type
        ));
        foreach ($posts as $p) {
            update_post_meta($p->ID, 'rank_math_focus_keyword', strtolower(get_the_title($p->ID)));
        }
    }
    add_action('init', 'update_focus_keywords');

    If you want us to check this further, please reactivate the login link.

    Looking forward to helping you.

    Thank You So much my issue is resolved

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 15 replies - 1 through 15 (of 16 total)

The ticket ‘setting up automatic focus keywords in pages and products.’ is closed to new replies.