During a hangout one SEO professional asked John Mueller about H1 heading tags.
More specifically, they wondered if adding a span or class attribute into an H1 heading tag would affect their website from an SEO perspective?
John explained that he doesn’t think so. His understanding is that Google would still see that as a heading.
So long as it’s a valid heading, they will be able to use that.
He doesn’t know, from a technical valid-HTML perspective, whether that’s the correct way to code a heading.
But from Google’s perspective, they would likely see that just as a heading.
The SEO pro then asked if it’s a problem for them to make an animation for their H1 heading, if they use the span class, because they saw their site go down in the rankings for some reason.
They don’t know whether it’s perhaps better to have clean H1 headings without anything inside of them?
John said that he does not imagine that a website would drop in its visibility just because of that change to a heading tag.
This happens at approximately the 26:01 mark in the video.
John Mueller Hangout Transcript
SEO Professional 7 26:01
Yes, good morning. I would like to ask you, does using HTML tags such as span or class into an H1 can affect my website from an SEO point of view?
John 26:21
I don’t think so. I mean, my understanding is that we would still see that as a heading. And as long as it’s a valid heading, we would be able to use that. I don’t know, from a technically, kind of valid HTML point of view, if that’s still the correct way to do a heading. But from our point of view, we would probably just see that as a heading.
SEO Professional 7 26:49
Okay, so it’s not a problem if I want to make animation for my H1, if I use the span class? Because we think that our website went down in the rankings for this reason and others. So I don’t know, if maybe it’s better to have clean H1 tags without anything inside? Or…
John 27:19
I think, I can’t imagine that a website would drop invisibility because of this.