wordpress-seo
wordpress-seo copied to clipboard
Wrong Duplicate h1 reported
- [x] I've read and understood the contribution guidelines.
- [x] I've searched for any related issues and avoided creating a duplicate issue.
Please give us a description of what happened.
Using the yoastseo library, I ran a SEO analysis on a page containing a single <h1> tag. The <h1> tag is nested within a custom element. The analysis displays the following result:
Single title: H1s should only be used as your main title. Find all H1s in your text that aren't your main title and change them to a lower heading level!
There are no javascript errors reported in the browser console.
Please describe what you expected to happen and why.
I would expect yoastseo to find just one <h1>, regardless whether that <h1> is wrapped in a custom element or not.
How can we reproduce this behavior?
I've created a minimal reproduction case in Code Sandbox: https://codesandbox.io/s/yoast-seo-custom-element-bug-mlgosb
Technical info
- If relevant, which editor is affected (or editors):
- [ ] Classic Editor
- [ ] Gutenberg
- [ ] Classic Editor plugin
- Which browser is affected (or browsers):
- [x] Chrome
- [x] Firefox
- [x] Safari
- [ ] Other
Used versions
- WordPress version: not relevant, issue occurs using
yoastseooutside of Wordpress - Yoast SEO version:
yoastseo1.91.0
👋 Thanks for submitting a detailed bug report with the proper Code Sandbox repo. I appreciate your effort on this.
I must say that it's an edge case as the issue doesn't occur inside WordPress but only when used on a standalone implementation. However, I will still make a report to the appropriate team internally. In the meantime, we are also open to PR from the community!