yoast-acf-analysis
yoast-acf-analysis copied to clipboard
ACF Shortcode won't work
Hello,
In my posts I use the ACF shortcode for text fields [acf field="text"] but the addon doesn't seem to recognize those and my Yoast does not recognize ACF.
Is the ACF shortcode supported by this plugin or what is the better way I should use ACF in my new posts?
Thanks,
This is currently not possible and will also not be included in the upcoming release. I'm keeping it as an enhancement idea here anyway.
But this won't be easy so don't hold your breath for it, sorry.
This is a tricky one.
The shortcode allows the retrieval of fields from some other post. To support that we'd need to create some API or maybe use the REST API to get that data from the server while editing another post.
When only using data from the same post we might be able to do this as we have already scraped all fields anyway. The fact that the docs state
Limitations
- Only works for simple text based values
might save us here. But we'd need to have a closer look at ACF to see how this is handled there to see if we can replicate the behaviour with reasonable effort.
Possibly relevant: https://github.com/Yoast/wordpress-seo/issues/4133#event-906393703
Please inform customer #1008005 when this conversation is closed.
Currently, the shortcodes are detected when using the Yoast-ACF glue plugin. But the text field is wrapped in a paragraph tag which causes the content before/after to be treated separate from the ACF content which may cause unexpected feedback (the colored bullets). Removing the paragraph tags should help the text field shortcodes work in a more consistent behavior.
Example:
I tested an ACF text field called city with a single word 'London'.