Using ACF instead of removed product description.

#1047581
  • Resolved yh
    Rank Math free

    I added a function which have removed the product description tab on my site and the “description” for the product page relies on ACF.

    So although i can still add the focus keyword in the standard product description, the content in the product description field would not be rendered by the HTML, would this make the optimization any less effective?

    Is there a need to change Rank Math’s recognition of product description to the custom ACF field instead? if yes, how so?

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

    We apologize for the issue you are facing. When using Advanced Custom Fields (ACF) for your product descriptions instead of the standard product description field, it is important to ensure that Rank Math recognizes the focus keywords from your ACF fields for effective optimization.

    If the content in your ACF field is not being recognized by Rank Math, it could indeed affect your SEO optimization since Rank Math checks for focus keywords in the standard product description. To make Rank Math recognize the focus keywords from your ACF fields, you will need to add a code snippet to your theme’s functions.php file. Here’s how you can do it:

    1. Navigate to the Theme File Editor: Go to Appearance → Theme File Editor in your WordPress dashboard.
      Navigate to the Theme File Editor

    2. Add the Code Snippet: Insert the following code snippet into your functions.php file:

      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 ) {
             // Replace 'your_acf_field_name' with your actual ACF field name.
             if ( ! get_post_meta( $p->ID, 'rank_math_focus_keyword', true ) && function_exists( 'get_field' ) && ( null !== get_field( 'your_acf_field_name', $p->ID ) ) ) {
                 update_post_meta( $p->ID, 'rank_math_focus_keyword', strtolower( get_field( 'your_acf_field_name', $p->ID ) ) );
             }
         }
      }
      add_action( 'init', 'update_focus_keywords' );

      Make sure to replace 'your_acf_field_name' with the actual name of your ACF field that contains the product description.

    This code will check if a focus keyword is already set for each product and, if not, it will update it using the value from your ACF field. This way, Rank Math will be able to optimize based on the content you have in your ACF fields.

    If you have any further questions or need assistance with this process, please feel free to reply to this ticket, and a human agent from our support team will assist you further!

    Sources:
    Is There a Way to Use ACF for Focus Keywords? » Rank Math

    yh
    Rank Math free

    I have already enabled the ACF module in the dashboard of Rank Math, so it does read the content in custom field. My main concern is whether the optimization will not be effective if the product description has been removed from being rendered in HTML.

    Hello,

    Thank you for reaching out to us.

    If the standard product description field is removed from the frontend and the visible content is pulled from an ACF field instead, then yes; for SEO purposes, what really matters is what’s rendered in the HTML of the page. As long as the ACF content is output properly in the frontend HTML and Rank Math’s ACF module is enabled (which you’ve confirmed), the optimization will remain effective.

    There’s no need to change how Rank Math detects the description unless the ACF field content is not actually rendered on the live product pages.

    We hope this helps. Please let us know if you have further questions or concerns.

    Thank you.

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

The ticket ‘Using ACF instead of removed product description.’ is closed to new replies.