ACF Focus Keyword not found in subheadings

#761776
  • Resolved Marvin Bangemann
    Rank Math free

    Hey RankMath team,

    I’m currently building a headless wordpress system for our company’s relaunch website, therefore we decided to make the SEO right this time and use your plugin to do so.

    One Problem we came across is that subheadings aren’t recognized from ACF Fields inside the Gutenberg Editor. We’re doing our headlines with a custom acf powered headline block, which has fields for the headline text and the headline type/level (h1,h2,h3,…).

    AFAIK the data from my ACF Fields is only recognized by RankMath when in EDIT mode, therefore it just gets the raw data and doesn’t know whether something is in a subheading or not.

    Since I guess there’s no way to “read” the content when the block is in Preview Mode (or is it?), my next approach was to add the ACF Fields to the RankMath Schema, but since this is generated in the Frontend, I don’t know if that’ sufficient. Do you have any idea or solution for my problem?

    I’d appreciate any help

    kind regards,
    Marvin

    ___

    Found a similar ticket here with dynamic data from elementor:
    https://support.rankmath.com/ticket/focus-keyword-not-found-in-subheadings-4/
    and another one according to ACF but its in the PRO subforum so I can’t see it: https://support.rankmath.com/ticket/acf-and-focus-keywords/

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

    Thank you for reaching out to us with your concern about ACF Focus Keywords not being found in subheadings. We appreciate your detailed explanation of the issue you are facing while building a headless WordPress system for your company’s website relaunch.

    Based on the information you provided, it seems that the subheadings created using a custom ACF-powered headline block are not being recognized by Rank Math when in Preview Mode due to the way the data is handled.

    To address this issue, you can consider adding the ACF Fields to the Rank Math Schema Generator using a filter in your theme’s functions.php or rank-math.php file. By customizing the JSON-LD output with the necessary ACF data, you can ensure that Rank Math recognizes the subheadings correctly for SEO purposes.

    Here is an example of how you can achieve this by modifying the JSON-LD output to include ACF data for subheadings:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
        // Add your custom logic here to include ACF data for subheadings
        return $data;
    }, 10, 2 );

    By implementing this filter, you can enhance the Schema output generated by Rank Math to include the relevant ACF data for subheadings, ensuring that your SEO strategy aligns with your custom content structure.

    If you encounter any challenges or need further assistance with implementing this solution, please feel free to reply to this ticket, and one of our human agents will be happy to assist you further.

    We appreciate your proactive approach to optimizing your website’s SEO and are here to support you throughout the process.

    Kind regards,
    Rank Math Support Team

    Sources:
    Is There a Way to Use ACF for Focus Keywords? » Rank Math
    Is There a Way to Use ACF for Focus Keywords? » Rank Math
    How to Enter SEO Meta Title, Description, and Focus Keyword » Rank Math
    How to Use ACF Fields in Schema Generator » Rank Math
    Score 100/100 With Rank Math Post Tests » Rank Math

    Hello,

    Thank you for contacting Rank Math support.

    Our plugin sees the content from the ACF fields as plain text and would not recognize the subheadings and images you are adding with the custom fields. The headings can only be recognized from the WYSIWYG Editor field type of ACF, which uses HTML tags when saving the post content in the database.

    In this case, you will have to ignore the tests.

    If you want to add the data from the ACF fields to the Schema, you can modify and use the following filter: https://rankmath.com/kb/filters-hooks-api-developer/#change-post-schema-data

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

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

The ticket ‘ACF Focus Keyword not found in subheadings’ is closed to new replies.