• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Does applying CSS to an h1 element affect SEO?

Brogan

XenForo moderator
Staff member
#1
An interesting question has arisen in relation to SEO; well, as interesting as SEO can be...

On the forum home page there is an h1 element which contains the forum name; in the case of XenForo.com it's XenForo Community.

Quite a few people have asked how this can be removed, but only on the forum home page.

This can be achieved several ways using CSS applied to EXTRA.css.

This one sets the font size to 0px:
Code:
.forum_list .titleBar h1 {
font-size: 0px;
}
This one prevents it from being displayed:
Code:
.forum_list .titleBar {
display: none;
}
I pay very little attention to SEO so will either of those affect it?

In both cases the h1 element is still present in the page source, it's just not visible.
 

bambua

Well-known member
#2
In my experience google does pay attention to the heading tags when it finds/examines keywords on a page so I have always included them for the page titles and such. In this specific situation though I'm not sure, would be interesting to find out.
 

Onimua

Well-known member
#3
If it's hidden via CSS, I don't see what difference it would make since spiders look at the HTML itself, don't they?
 

bambua

Well-known member
#4
If it's hidden via CSS, I don't see what difference it would make since spiders look at the HTML itself, don't they?
I think that's what he meant, if you don't want it there does it help SEO to just hide it from vision or should you get rid of it all together.
 

bambua

Well-known member
#6
That's my understanding too, I just want to clarify it to put the minds of others to rest.
You can test this pretty easily, using Google Webmaster Tools you can view the page as the google spider will. I just tried it on one of my pages and google still sees with either of those CSS entries.
 

Brogan

XenForo moderator
Staff member
#8
Thanks guys, pretty much as I suspected.

I'm aware of Google's policy on cloaking, but hopefully they will realise that this is just for cosmetic/aesthetic reasons and not to try and game the system in any way.
 

Carlos

Well-known member
#9
The cloaking you refer to is embedding keywords into the bottom (common practice) and deceive visitors from knowing what's with the white space. In this instance; let's say your site is xenforo, and you want a a thousand keywords at the bottom, which means you want a light grey color for your keywords.... This is where Google punishes you.

While what you want to accomplish doesn't really punish you, it doesn't help, either... because you're almost removing the H1 tags.
 

Carlos

Well-known member
#11
I'm not sure how it doesn't help, it has no effect on how the spider sees it.
"Quite a few people have asked how this can be removed, but only on the forum home page."

When visitors come to your site, they see board title with H1 tags... the bots, see it too...

So, what happens when you remove it? Especially if you put keywords that YOU want in the forumhome?

Let's suppose for a second you want to target Modern Warfare 3 fans, if you really want to do it, you put it in the board title and leave the H1 tags. Google and other search engines will find you based on that. Removing it means losing SEO trails to your [landing] site.

This means a decrease in visits to your site.

So, this leaves Google and other search engines to find your thread titles instead...which is a lot harder than you think... unless you use twitter or facebook for marketing.
 

bambua

Well-known member
#12
"Quite a few people have asked how this can be removed, but only on the forum home page."
Both of the examples he gave are ways of removing them from view, not physically removing the H1 title from the HTML. Just removing it from how it is rendered in the browser. This is no different than using a span with a background image in a H2 tag and using a text-indent: -99999 or whatever to throw the text off the screen and just show your image. They are both ways of effecting the rendered view while still giving screen readers and the search bots the text you want them to see.
 

Brogan

XenForo moderator
Staff member
#19
Thanks Floris, we've already discussed Google's cloaking policy.

My understanding is that as it's not "deceptive in intent" then it should be fine.
It's simply done for aesthetic reasons.

Of course Google may see things differently.
 
F

Floris

Guest
#20
Thanks Floris, we've already discussed Google's cloaking policy.

My understanding is that as it's not "deceptive in intent" then it should be fine.
It's simply done for aesthetic reasons.

Of course Google may see things differently.
Sure, but now you have the info directly from Google - not a third party site with an opinion.
And as you said, if you're not trying to game the system, there's nothing to worry about (SEO) wise.