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

If a Custom Element is used as a placeholder for an HTML heading, would it be interpreted as a heading for SEO purposes? #730

Closed
TimeDropsSB opened this issue Feb 6, 2018 · 5 comments

Comments

@TimeDropsSB
Copy link

I have a Custom Element, <our-h1>. <our-h1> is a placeholder such that when it is upgraded, it becomes a regular <h1> through DOM manipulation - that is, <our-h1> is replaced with <h1>.

In terms of SEO, would the constructed <h1> from <our-h1> be the same as if it was using an <h1> directly?

@domenic
Copy link
Collaborator

domenic commented Feb 6, 2018

It depends on whether the search engine in question understands custom elements. That's not going to have a single easy answer, unfortunately.

@trusktr
Copy link
Contributor

trusktr commented Feb 10, 2018

This is a problem that can be solved by Element Behaviors. See the section "augment existing HTML applications".

If you don't really need to extend from a heading element, you can just apply functionality as a behavior. (see working implementation)

@trusktr
Copy link
Contributor

trusktr commented Feb 10, 2018

It depends on whether the search engine in question understands custom elements.

Probably that's a problem right now. F.e., @Sylphony, a bot that just reads HTML strings (without looking at the JavaScript DOM objects) could not possibly know that <my-header-1> is an extended <h1>.

@annevk
Copy link
Collaborator

annevk commented Feb 16, 2018

This is already addressed by the standard: https://html.spec.whatwg.org/#custom-elements-autonomous-drawbacks.

@annevk annevk closed this as completed Feb 16, 2018
@OvermindDL1
Copy link

And for note, this is one thing that the is="..." solves.

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

No branches or pull requests

5 participants