Hello,
Thank you for reaching out to us. I understand that you are facing an issue with the Rank Math plugin regarding the ALT tags of images when using ACF fields.
Based on the information provided, it seems that the ALT tags filled in for the images are not being recognized by Rank Math, even though they are correctly set in the source code. This could be related to the way ACF fields are being used for images.
To ensure that Rank Math recognizes the ALT tags from ACF fields, you can follow these steps:
- Update the Focus Keyword Using ACF Field: You can add a code snippet to your theme’s
rank-math.php file to update the focus keyword using the ACF field. Here is the code snippet you can use:
function update_focus_keywords() {
$posts = get_posts(
array(
'posts_per_page' => -1,
'post_type' => 'post', // replace post with the name of your post type.
)
);
foreach ( $posts as $p ) {
// Replace 'article_topic' with your ACF field name.
if ( ! get_post_meta( $p->ID, 'rank_math_focus_keyword', true ) && function_exists( 'get_field' ) && ( null !== get_field( 'article_topic', $p->ID ) ) ) {
update_post_meta( $p->ID, 'rank_math_focus_keyword', strtolower( get_field( 'article_topic', $p->ID ) ) );
}
}
}
add_action( 'init', 'update_focus_keywords' );
- Add the Code Snippet: Update the focus keyword using the ACF field by adding the provided code snippet to your theme’s
rank-math.php file. Make sure to replace 'article_topic' with your actual ACF field name.

After adding and updating the code snippet, make sure to save the changes and check if Rank Math recognizes the ALT tags from ACF fields correctly.
If you need further assistance or have any other questions, feel free to ask. Thank you for using Rank Math!
Best regards.
Sources:
Score 100/100 With Rank Math Post Tests » Rank Math
Is There a Way to Use ACF for Focus Keywords? » Rank Math
Analyzing Your Site’s SEO with Rank Math’s SEO Analysis Tool
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.