Yoast / yoast-acf-analysis

WordPress plugin that adds the content of all ACF fields to the Yoast SEO score analysis.
https://wordpress.org/plugins/acf-content-analysis-for-yoast-seo/
GNU General Public License v3.0
61 stars 20 forks source link

The plugin is not compatible with ACF gutenberg blocks #241

Closed DB-Alex closed 4 years ago

DB-Alex commented 4 years ago

When I use the ACF gutenberg blocks, I still see that I do not have any content or links on the page.

https://www.advancedcustomfields.com/resources/blocks/

I am using the render_callback function from ACF

'render_callback' => array($this, 'block_render_callback'),
TimVevida commented 4 years ago

+1

We are using a custom made theme where all blocks (exept paragraphs) have been disabled and content is added using custom made ACF blocks. The content of these blocks is not being recognized by this plugin. We have used the yoast-acf-analysis/headlines filter.

Side note: How to debug the information that is passed to Yoast SEO? It is currently very hard to see if the content is being passed or not.

TimVevida commented 4 years ago

Update: when putting all my custom ACF blocks in edit mode, the content is picked up by this plugin and passed to Yoast SEO. Filters like yoast-acf-analysis/headlines work as expected,

As most ACF blocks will be wrappers around basic input fields, it should not be too hard to make this work, I think? Maybe we could push the ACF developers not to remove the edit fields from the DOM, as they do now, but to hide them. Then they can be picked up by this plugin anytime. Custom fields in the sidebar are hidden instead of removed from the DOM and they are being found by this plugin.

TimVevida commented 4 years ago

Alternatively, we could put back control in the hands of the developer: the preview of your custom block should resemble the final output as close as possible, so why not pass the rendered HTML of the preview straight to Yoast SEO?

TimVevida commented 4 years ago

I opened a support ticket at ACF, and Elliot (ACF dev) replied:

In theory, it should be possible for Yoast SEO to connect with ACF Blocks content.

ACF Blocks are simply Dynamic blocks, meaning that they use PHP to render HTML instead of JS.

Can you please ask the Yoast team if their plugin is compatible with "dynamic" blocks? If not, is this something they are working towards?

DB-Alex commented 4 years ago

Thats good news, lets hope one of them will pick it up soon!

tim9192 commented 4 years ago

Hey @alexvandervegt & @TimVevida Do you guys already have a solution for this problem? I have the exact same problem and I don't find anything about this on the web...

TimVevida commented 4 years ago

My patch has been accepted and merged, just waiting for a new release now.

DB-Alex commented 4 years ago

@JesserH @TimVevida Yoast 14.1 just released is this patch included?

Cause I dont see any difference

TimVevida commented 4 years ago

You have to wait for a release of this glue plugin (Yoast ACF Analysis). Maybe @JesserH has a roadmap?

IreneStr commented 4 years ago

@alexvandervegt @TimVevida We're planning on releasing ACF 2.4.0, including this fix, on May 26th. If you'd like to test beforehand, you can find the RC here: https://github.com/yoast/yoast-acf-analysis/releases. Please be aware that this is an RC version, which means it might not be 100% stable yet. We strongly discourage testing it on a live website.

DB-Alex commented 4 years ago

@IreneStr When can we update the plugin? When I upload the RC from github I have this warning:

ACF Content Analysis for Yoast SEO could not be loaded because of missing files.
IreneStr commented 4 years ago

@alexvandervegt It looks like we forgot to do the release on May 26th. My sincere apologies! I'll make sure we'll release as soon as possible.

About the error: did you use the zip from the releases page? We cannot reproduce your error locally with that zip.

DB-Alex commented 4 years ago

@IreneStr Do you have a timeframe for it?

IreneStr commented 4 years ago

@alexvandervegt We've released the plugin a few minutes ago. You can find the newest version on the WordPress plugin repository (or just hit the update button in your site's backend, of course 😄). Again, our apologies for the delay!

DB-Alex commented 4 years ago

Thanks for the update. We have installed it but unfortunately we still have red lights because Yoast Seo says we 0 words in our content. As you can see in the screens below:

Screenshot 2020-06-04 at 08 55 13 Screenshot 2020-06-04 at 08 56 17 Screenshot 2020-06-04 at 08 57 02 Screenshot 2020-06-04 at 08 57 08

@TimVevida Is your problem solved by the update?

TimVevida commented 4 years ago

@alexvandervegt The content of your post/page is made up of ACF custom blocks?

With ACF content analysis for Yoast SEO at version 2.4.0, I get that Yoast found 438 words in a page consisting solely of custom blocks.

freinbichler commented 4 years ago

@TimVevida I also get 0 words on a page that consists only of ACF blocks. Only when I click every block to edit them, the content gets recognised by Yoast. I have figured out what the problem is: my blocks use the "auto" mode, where when I click the block, the fields replace the block content inline. When I don't use the "auto" mode, and the fields appear in the sidebar on click, it works as expected. However I have many repeater fields and longer text fields and the sidebar is a little too small to fit all that.

To reproduce, register your blocks with the following option:

acf_register_block_type(array(
  ...
  'mode' => 'auto',
  ...
));

Maybe a solution can be found so that it can also work in "auto" mode. However, thank you for your work to make ACF blocks compatible!

EDIT: I have created a new issue for this problem: https://github.com/Yoast/yoast-acf-analysis/issues/261

DB-Alex commented 4 years ago

I think thats my problem also, we also have all blocks on auto mode

TimVevida commented 4 years ago

I have not specified a mode (defaults to preview), so that could be the issue, indeed. Thanks for the diagnostics. :) I will look into this.

DB-Alex commented 4 years ago

That would be awesome!!

Nicscott01 commented 2 years ago

I had the same issue, where content in my ACF blocks was not being recognized by Yoast SEO content analysis. Registering my blocks with 'mode'=>'preview' enables the button that switches between edit/preview.

When in preview mode, the Yoast content analysis works.

It would be excellent to have a way to either a) read the rendered content in the Yoast ACF Analysis plugin or b) have a quick mode to switch all blocks to preview mode.

welenofsky commented 1 year ago

I have recently ran into this issue for a client of ours. It seems that this workaround may no longer work/it did not work for us. We built the site using ACF to create gutenberg blocks. I have tried toggling the blocks to preview and it seemed to not have any change. If I were to add text using the default paragraph block yoast was able to see the content.

edwardpanas commented 1 year ago

Any updates on this issue? We are having the same problem with Yoast not analyzing content in our custom ACF blocks. Before we pay our developers to install the Yoast ACF "glue" plugin I'd like to have an idea if it works. Thanks!