Unable to automate insert keywords

#1032201
  • Hi,

    I followed your guide on how to automate insertion of keywords and in my Theme Editor, I do not have rank-math.php

    The theme I’m using is a child theme with the parent theme ‘YITH Proteo’

    Even in the parent theme there is no rank-math.php

    I asked the question on your website chat/help AI and it suggested created one, which, when I did, didn’t work and brought up errors until I deleted it.

    I have over 950 products on my site and don’t want to have to manually edit each one as that would take a LONG time to do!

    Is there another way of achieving this or should I be looking at an alternative solution?

    Site link in box below and if you need Admin access I can provide this.

    Best,
    Scott Hallam

Viewing 1 replies (of 1 total)
  • Hello,

    We apologize for the issue you are facing with automating the insertion of keywords. It sounds like you’re encountering some challenges with the rank-math.php file in your child theme.

    Since you mentioned that there is no rank-math.php file in either your child or parent theme, creating one is indeed the right approach. However, if it brought up errors, it might be due to incorrect code or placement. Here’s a step-by-step guide to help you set it up correctly:

    1. Create the rank-math.php File: If you haven’t already, create a new file named rank-math.php in your child theme directory (/wp-content/themes/your-child-theme/).

    2. Add the Code Snippet: Open the newly created rank-math.php file and add the following code snippet:

      /**
      * 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' // Ensure this matches 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');
    3. Save and Test: After adding the code, save the file and check if it works without errors.

    If you continue to experience issues, we recommend using our professional setup service to ensure everything is configured correctly. You can find more information about this service at Rank Math Professional Setup Service. This service requires a PRO subscription and is designed for users who want to ensure their plugin setup is fully correct and adheres to the latest SEO standards.

    If you have any further questions or need assistance, please reply to this ticket with your site URL, and we can provide more tailored support. Thank you for raising this concern!

    This is an automated reply from Rank Math Support Bot. If you need further assistance, please reply to this topic and a human support agent will reply to you shortly.

    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 1 replies (of 1 total)

The ticket ‘Unable to automate insert keywords’ is closed to new replies.