• Hi everyone,

    I have a custom development with WordPress where all the content is managed through ACF (Advanced Custom Fields) and not through the default the_content() function, which Yoast uses for its content analysis. To ensure Yoast reads my ACF content, I am using the ACF Content Analysis for Yoast SEO plugin (plugin link).

    The plugin successfully reads the ACF content but fails to recognize the content type (whether it’s a <p> or <h1>). I attempted to use the provided filter in my functions.php to define headlines, but it doesn’t seem to work. Here’s the filter I implemented:

    php

    Copy code

    add_filter('Yoast\WP\ACF\headlines', function ($headlines) { $headlines['hero_title'] = 1; // h1 $headlines['hero_subtitle'] = 2; // h2 $headlines['hero_feature_1'] = 3; // h3 $headlines['hero_feature_2'] = 3; // h3 $headlines['hero_feature_3'] = 3; // h3 $headlines['advantage_1_title'] = 3; // h3 $headlines['advantage_2_title'] = 3; // h3 $headlines['advantage_3_title'] = 3; // h3 $headlines['charging_models_section_title'] = 2; // h2 $headlines['charging_model_1_title'] = 3; // h3 $headlines['charging_model_2_title'] = 3; // h3 $headlines['charging_model_3_title'] = 3; // h3 $headlines['charging_model_4_title'] = 3; // h3 $headlines['payment_channels_section_title'] = 2; // h2 $headlines['gateways_section_title'] = 2; // h2 $headlines['block_1_title'] = 3; // h3 $headlines['block_2_title'] = 3; // h3 $headlines['block_3_title'] = 3; // h3 $headlines['block_4_text'] = 3; // h3 $headlines['analysis_section_title'] = 2; // h2 $headlines['notifications_section_title'] = 2; // h2 $headlines['recover_payments_section_title'] = 2; // h2 $headlines['scale_section_title'] = 2; // h2 $headlines['scale_section_indicator_title'] = 3; // h3 $headlines['other_features_section_title'] = 2; // h2 $headlines['other_features_section_title_1'] = 3; // h3 $headlines['other_features_section_title_2'] = 3; // h3 $headlines['other_features_section_title_3'] = 3; // h3 $headlines['banner_title'] = 2; // h2 $headlines['banner_feature_1'] = 3; // h3 $headlines['banner_feature_2'] = 3; // h3 $headlines['banner_feature_3'] = 3; // h3 return $headlines; });

    In my template, the fields are called like this:

    php

    Copy code

    <h1 class="body-extraHuge"><?php the_field('hero_title'); ?></h1> <h2 class="body-extraBig"><?php the_field('hero_subtitle'); ?></h2> <h3 class="feature-txt"><?php the_field("hero_feature_{$i}"); ?></h3>

    However, Yoast’s analysis reports that there are no subheadings, even though they are present in the template. Here is what the Yoast analysis shows:

    Problems:

    • Subheading distribution: You are not using any subheadings, although your text is rather long. Try and add some subheadings.

    Improvements:

    • Transition words: Only 5.4% of the sentences contain transition words, which is not enough. Use more of them.

    Good results:

    • Passive voice: You’re using enough active voice. That’s great!
    • Consecutive sentences: There is enough variety in your sentences. That’s great!
    • Paragraph length: None of the paragraphs are too long. Great job!
    • Sentence length: Great!

    I have ensured that the field names are correct and matched with the filter. I also cleared the cache and updated the plugins, but the issue persists.

    Any insights or suggestions on how to fix this would be greatly appreciated.

    Thanks in advance!

  • You must be logged in to reply to this topic.