: Will Google penalize my website if I hide the H1 tag? I've read an article today where the author stated that if you put keywords on to your page but then hide them with CSS, Google will
I've read an article today where the author stated that if you put keywords on to your page but then hide them with CSS, Google will penalize your site. This make sense.
This got me thinking though about my own technique when I build a website. If for example when I build a website and the logo contains the name of the website, I tend to put the name of the website in a H1 tag and then hide this tag. I don't know why I do it, I've always done it. I also include any text held in an image in the alt attribute of the img tag.
But because I am hiding the H1 tag, does this leave me open to Google penalizing the website because I've hidden this one tag?
More posts by @Shakeerah822
7 Comments
Sorted by latest first Latest Oldest Best
We are talking about the site name here. In most cases it will not be that long and it usually will be repeated several times on each page. So this should be no problem for any search engine, as it is hard to see how this could possibly trick their users. This can not be compared to cases where someone hides various keywords that are not repeated in or relevant to the content.
However, that doesn't mean that you should do it.
I don't know why I do it, I've always done it.
Now is the time to rethink it. Why would you do something like that at all? The logo is (or represents) the name/title of the site. So it should be in h1. Depending on your hiding method, the heading might be hidden for screenreaders, too (which could break the outline navigation many screenreader users use).
If you want to display provide both, logo and name, you can put them both in the same h1, or you could use the HTML5 hgroup element.
<!-- variant 1 -->
<h1><img src="acme-logo.png" alt="" />ACME Inc.</h1>
<!-- variant 2 -->
<hgroup>
<h1><img src="acme-logo.png" alt="" /></h1>
<h2>ACME Inc.</h2>
</hgroup>
Note that the alt attribute value should be empty here:
the alt attribute's value should not repeat information that is already provided in the prose next to the image
If you want to only use the logo, it's fine too:
<h1><img src="acme-logo.png" alt="ACME Inc." /></h1>
Regarding the other answers:
It's totally fine and good and in many cases even required (for the outline of the document) to use h1 for the site title, not for the page content title. In HTML5 you can use h1 for both titles, though (in combination with sectioning elements).
A CSS image-replacement method should not be used for the site logo, as it is content (HTML), not decoration (CSS)
FWIW: regarding all of the talk about being penalized by the "The Central Scrutinizer", Google itself hides text on its search results <h2 class="hd">Search results</h2> page:
.hd {
height: 1px;
overflow: hidden;
position: absolute;
top: -1000em;
width: 1px;
}
As Su' mentioned image replacement is pretty standard. You'll likely get more bang out your H1's if you make them unique on each page (for example by using the title of the article as the H1).
As far as getting penalized Google does specifically target hidden text as a form of SPAM, however, they have always said "just build your website the way you would if search engines didn't exist and you'll be fine" theoretically that means you should be fine and they should be able to tell the difference between manipulative hidden text and hidden text that occurs naturally.
I personally don't like to leave things like that up to Google to figure out so I'd recommend moving your H1 to the main content of the site, article title, product title or whatever your content warrants. That way it's unique, which G likes, it's relevant to the content, which G likes, and is in plain sight for both people and bots.
for example when I build a website and the logo contains the name of the website, I tend to put the name of the website in a H1 tag and then hide this tag. I also include any text held in an image in the alt attribute of the img tag.
It's a little vague, but if by this you mean that you hide the H1 and then also have a separate img tag which then presents the logo, you're duplicating effort(and as others have said, potentially opening yourself up to hidden content penalties). Why not look into using an image replacement method instead? You're most of the way there already, just doing it in multiple steps.
Realistically, you could just stick the image directly in the H1, but some people prefer having text in their source; your call.
You are correct to be worried about getting banned for the H1 tag issue. If you are worried that your site might be currently banned, I would suggest using Google's webmaster tools to see any messages that Google has posted about your content. They also have several tools that you can use to make sure your site is in compliance.
Regarding the 'alt' tag, keep doing this! Not only does Google use the alt tag to understand images, but also screen reader software uses the same alt tag to help visually impaired people navigate your site.
Google Webmaster Tools can be found here
Yes - it possibly can lead to Google penalizing your site. Google always looks at the alt tag to determine the text that is concealed in an image so there really isn't any need to add the title in the h1 tag. You can also just specify the keywords in your meta tags as well as the page title.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.