ACF content only recognized after editing.

#994487
  • Hello Rank Math Support,

    I’m experiencing an issue where Rank Math’s SEO score is not correctly displayed on the initial load of a page/post within the WordPress editor. This issue is specific to pages/posts containing custom ACF blocks.

    Here’s a breakdown of the problem:

    Rank Math correctly analyzes standard content (text paragraphs, etc.).
    The Rank Math column in the page list displays the correct SEO score.
    The issue only occurs on the initial load of a page/post within the editor.
    After making any edit to the page/post, Rank Math correctly analyzes the content and updates the score.
    When I run the javascript code:
    JavaScript

    window.addEventListener(‘load’, function() {
    setTimeout(function() {
    if (typeof rankMathEditor !== ‘undefined’ && typeof rankMathEditor.refreshAnalysis !== ‘undefined’) {
    console.log(“Forcing RankMath analysis”);
    rankMathEditor.refreshAnalysis();
    } else {
    console.log(“Rankmath analysis not found”);
    }
    }, 5000); // 5-second delay
    });
    I get the console log: “Rankmath analysis not found”.

    I have already taken the following troubleshooting steps:

    Deactivated all other plugins.
    Switched to a default WordPress theme.
    Tested on multiple pages.
    My environment details are:

    WordPress: 6.7.2
    Rank Math: Version 1.0.240
    ACF PRO: Version 6.3.12
    Could you please provide information about how Rank Math’s analysis is initialized within the editor? Are there any JavaScript hooks or events that I can use to trigger the analysis on initial page load?

    Thank you for your assistance.
    Sam.

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

    We apologize for the issue you are facing with Rank Math’s SEO score not being correctly displayed on the initial load of pages/posts containing custom ACF blocks. Thank you for providing detailed information about the problem and the troubleshooting steps you’ve already taken.

    To address your question regarding how Rank Math’s analysis is initialized within the editor, it’s important to note that Rank Math uses a Content Analysis API that can be integrated with custom fields, including those from ACF. However, if the analysis is not triggering on the initial load, it may be due to how the content is being rendered or recognized by Rank Math.

    Here are a few suggestions:

    1. Ensure Custom Fields are Registered: Make sure that your custom fields are properly registered with Rank Math’s Content Analysis API. You can refer to our Content Analysis API documentation for guidance on integrating custom fields.

    2. Use JavaScript Hooks: While you mentioned using rankMathEditor.refreshAnalysis(), ensure that you are calling this function after the content is fully loaded. You might want to try using other hooks or events that trigger after the ACF blocks are rendered. Unfortunately, specific hooks for ACF blocks may not be documented, so testing different timing or events might be necessary.

    3. Check for Errors: Open your browser’s console and check for any JavaScript errors that might indicate why rankMathEditor is not defined at the time you are trying to call it.

    4. Rebuild Index: If you haven’t already, try rebuilding the index for analytics in Rank Math by navigating to Rank Math > Status & Tools > Database Tools > Rebuild Index for Analytics. This can sometimes resolve issues related to content not being recognized correctly.

    If these suggestions do not resolve the issue, please reply to this ticket with your site URL so that a human agent from our support team can assist you further.

    Thank you for your patience, and we look forward to helping you resolve this issue!

    Sources:
    Rank Math Content Analysis API for Theme & Plugin Developers
    How to Make Your Theme Rank Math Compatible » Rank Math

    Hello Rank Math Support,

    I have further investigated the issue, and I can confirm that the rank_math_content filter is working correctly. The ACF block content is being successfully added to the content that Rank Math analyzes. I have attached the console output from my testing.

    The issue remains that Rank Math’s SEO score is not correctly displayed on the initial load of a page within the editor. It works correctly after any edit to the page.

    Could you please provide detailed information about the JavaScript events or functions that trigger Rank Math’s analysis on editor load? Are there any specific JavaScript hooks or events that I can use to trigger the analysis? Also, the rankMathEditor.refresh function is not available on page load, and the console log “Rankmath analysis not found” is displayed.

    Thank you for your assistance.”

    This additional information will help Rank Math support better understand the problem and provide a more targeted solution.

    Hello Rank Math Support,

    I have further investigated the issue, and I have discovered that Rank Math’s content analysis within the editor is consistently processing only the first block on the page. This occurs after and during editing.

    What can I do to make it combine the blocks and do analysis on the entire page’s content?

    Thank you for your assistance.

    Hello,

    Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.

    Can you please share a screencast of the issue by using a tool like https://loom.com so that we can check this further for you?

    Looking forward to helping 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 4 replies - 1 through 4 (of 4 total)

The ticket ‘ACF content only recognized after editing.’ is closed to new replies.