Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal links not registering for custom dynamic blocks #13608

Open
8 of 10 tasks
korynorthrop opened this issue Oct 8, 2019 · 2 comments
Open
8 of 10 tasks

Internal links not registering for custom dynamic blocks #13608

korynorthrop opened this issue Oct 8, 2019 · 2 comments

Comments

@korynorthrop
Copy link

korynorthrop commented Oct 8, 2019

  • I've read and understood the contribution guidelines.
  • I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened.

I receive the following warning in the SEO Analysis in the post editor “No internal links appear in this page” even though there are internal links present, but they are inside of a custom block that'd rendered dynamically either using ACF Pro or Wordpress core's render_callback method. I have seen a few other people create tickets about this issue on the Wordpress.org Yoast SEO plugin page (https://wordpress.org/support/plugin/wordpress-seo/), but all of those tickets were closed due to inactivity and lack of follow-up from the people who opened the ticket. That is why I’m opening one here.

Please describe what you expected to happen and why.

I expect that Yoast SEO plugin would detect the internal links (since they are contextual) in the custom blocks and the warning would not appear.

How can we reproduce this behavior?

  1. Create a custom block that outputs an internal (contextual) link using Wordpress' registerBlockType() function or Advanced Custom Fields' (ACF) acf_register_block()
  2. Add the custom block to a Post and save
  3. Check the SEO Analysis and see the internal links warning

I've tried this multiple ways. With ACF, I have a Repeater field that uses a Post Object sub-field to choose the internal Post to link to. That doesn't work. I have a React custom block that uses the core registerBlockType() function and outputs the content dynamically using render_callback when registering the custom block in PHP with register_block_type(). With this approach even hard-coding a <a> tag with a valid internal URL doesn't get picked up.

The only way I've gotten this to work with a custom block is if the output is not rendered dynamically. I can create a custom block via React and hard-code a <a> tag with an internal href attribute and when I save the Post I see that an internal link is detected.

Technical info

  • WordPress version: 5.2.3
  • Yoast SEO version: 12.2

I’ve tried disabling all other plugins (except the ones needed to register the custom block), but the issue still remains.

  • If relevant, which editor is affected (or editors):
  • Classic Editor
  • Gutenberg
  • Classic Editor plugin
  • Which browser is affected (or browsers):
  • IE11
  • Edge
  • Chrome
  • Firefox
  • Safari
  • Relevant plugins in case of a bug: * Advanced Custom Fields Pro (version: 5.8.4)
  • Tested with theme: Twenty Nineteen and custom theme
@JosepfHaslam
Copy link

Simply adding support to this request. 100% identical issue.
Technical environment is similar:
WordPress 5.2.2
Yoast SEO Premium 12.3
ACF Pro 5.8.6
ACF Content Analysis for Yoast SEO 2.3.0
Tested with Themes 2019 and custom.

@daveyjones
Copy link

It looks like this is still an issue in 2022. Currently, I'm telling clients to ignore Yoast's internal link counting as it's not accurate due to this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants