How to hide the H1 tag and stay whitehat

by aprilm
9 replies
  • SEO
  • |
All my page titles are set to be <H1> tags. I have one page on my site where the design does not flow with the page title showing. I installed a plugin to hide the page title on chosen pages, but when I run it through a tag checker, the title is still showing in the source code.

Is there any way to do this so it doesn't appear I am trying to trick the SE's?

Hope this makes sense.

Thanks!

I am using Drupal by the way.
#hide #stay #tag #whitehat
  • Profile picture of the author InitialEffort
    I honestly wouldn't worry about it too much. This is not even a minor concern.
    {{ DiscussionBoard.errors[3508995].message }}
  • Profile picture of the author yukon
    Banned
    Wrap an image with the <h1> tag, I've been doing this for 5-years, your ALT-text will show up inside Google Cache (text-version) as plain text.

    Learned this back in the day from an old blogspot template.

    Code:
    <h1>
    <img src="/images/image_name.jpg" alt="Keyword1" width="30" height="30" />
    </h1>
    {{ DiscussionBoard.errors[3509099].message }}
    • Profile picture of the author aprilm
      Originally Posted by yukon View Post

      Wrap an image with the <h1> tag, I've been doing this for 5-years, your ALT-text will show up inside Google Cache (text-version) as plain text.

      Learned this back in the day from an old blogspot template.

      Code:
      <h1>
      <img src="/images/image_name.jpg" alt="Keyword1" width="30" height="30" />
      </h1>
      Thanks! I actually want to set my own H1 tags on the page, but the problem is, the title of the post shows up in the source code as my H1 (whether or not I choose to hide it on the page) because my titles are set to display as H1 tags.

      I need titles on all my pages but one. But if I hide the title on that one post, even though the title doesn't show up on the page to my user, it still shows on my source code to the SE's.

      I always thought that would look deceptive. I guess my question is, how do I disable the title being my H1 tag JUST on one post. Is there some kind of CSS code I can put in the body of the post?
      {{ DiscussionBoard.errors[3509279].message }}
      • Profile picture of the author yukon
        Banned
        My CSS is a bit rusty, I think this will work.


        (CSS code)
        Code:
         .my_new_div1 h1 {
        font-size:14px;
        font-weight:bold;
        }
        (Div code)
        Code:
        <div class="my_new_div1">
        <h1>
        <img src="/images/image_name.jpg" alt="Keyword1" width="30" height="30" />
        </h1>
        </div>



        Originally Posted by aprilm View Post

        Thanks! I actually want to set my own H1 tags on the page, but the problem is, the title of the post shows up in the source code as my H1 (whether or not I choose to hide it on the page) because my titles are set to display as H1 tags.

        I need titles on all my pages but one. But if I hide the title on that one post, even though the title doesn't show up on the page to my user, it still shows on my source code to the SE's.

        I always thought that would look deceptive. I guess my question is, how do I disable the title being my H1 tag JUST on one post. Is there some kind of CSS code I can put in the body of the post?
        {{ DiscussionBoard.errors[3509456].message }}
        • Profile picture of the author aprilm
          Originally Posted by yukon View Post

          My CSS is a bit rusty, I think this will work.


          (CSS code)
          Code:
           .my_new_div1 h1 {
          font-size:14px;
          font-weight:bold;
          }
          (Div code)
          Code:
          <div class="my_new_div1">
          <h1>
          <img src="/images/image_name.jpg" alt="Keyword1" width="30" height="30" />
          </h1>
          </div>
          Thanks Yukon, I will give it a whirl!!
          {{ DiscussionBoard.errors[3509526].message }}
          • Profile picture of the author aprilm
            Originally Posted by aprilm View Post

            Thanks Yukon, I will give it a whirl!!
            Hey Yukon,
            I gave it a whirl, and what you gave me worked. But now my page has 2 <H1> tags. Is there a way to eliminate the title (even though it's hidden) to not show in the source code just for this page? Or maybe even to set it at just normal paragraph text...just for this specific page?

            Thanks!!:rolleyes:
            {{ DiscussionBoard.errors[3509730].message }}
  • Profile picture of the author yukon
    Banned
    If you want to go BH, this will only display your Alt-text & Image to Google, not your traffic.

    Will also display <h1> text on the Google cache, from the image alt-text.


    (CSS Code)
    Code:
    /*My-New-Image*/
    .my-new-img {
    float: left;
    margin-top: 0;
    margin-right: 5px;
    margin-bottom: 5px;
    margin-left: 60px;
    padding: 0px;
    border: 0px solid #ffffff;
    width:20 px;
    height:20px;
    display:none;
    }


    (Div Code)
    Code:
    <h1><span class="my-new-img"><img src="http/www.domain.com/" alt="keyword_here" title="keyword_here"/></span></h1>
    {{ DiscussionBoard.errors[3509520].message }}
  • Profile picture of the author yukon
    Banned
    Make sure to backup your Wordpress theme pages before doing edits.

    The CSS is the same.

    The php code works based on a single unique Wordpress Tag (imageh1tag), this WP-Tag is case sensitive & you can only have a single tag (per post) for this code to work.

    The upside is, If you ever have another post that needs this (new <h1> tag) to be done, all you'll have to do is give the future post the exact same WP-Tag (imageh1tag).

    You can name the unique WP-Tag whatever you want, just make sure the code is updated below, & remember the php tag in the code below is case sensitive.

    Replace Old_H1_Code_Here with your old <h1> code that you already have.

    (CSS code)
    Code:
    .my_new_div1 h1 {
    font-size:14px;
    font-weight:bold;
    }

    (PHP/DIV code)
    Code:
    <?php 
    if ();
     = get_the_tags();
    foreach( as ) {
    	if ( == "imageh1tag" ) {
    ?>
    
    <div class="my_new_div1">
    <h1>
    <img src="http://www.domain.com/images/image1.jpg" alt="Keyword1" width="30" height="30" />
    </h1>
    </div>
    
    <?php 	} else {	
    
    ?>
    
    Old_H1_Code_Here
    
    <?
    }
    }
    ?>
    {{ DiscussionBoard.errors[3510236].message }}
    • Profile picture of the author aprilm
      Wow. Thanks for posting all that! It's about 1:00 a.m. so I will try this tomorrow. Thank you SO much, you are so generous.
      {{ DiscussionBoard.errors[3510887].message }}

Trending Topics