1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

A safe way of hiding content?

Discussion in 'HTML & Website Design' started by mark_s, Apr 16, 2007.

  1. #1
    I need to hide some content of my website but without using HTML commenting and if I use CSS to hide it then it is seen as cloacking my Google...

    Is there another method?

    I hide the content when I don't want to display a news alert and then unhide it when I do... HTML comments don't work with the way I have my website integrated with my forum.
     
    mark_s, Apr 16, 2007 IP
    MaryMary likes this.
  2. pixel_dust

    pixel_dust Peon

    Messages:
    151
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you could put it all in javascript and just use the document.write command
    and call it into your document as needed
    search engines ignore javascript so it's a safe bet


    vanessa.
     
    pixel_dust, Apr 16, 2007 IP
  3. 8everything

    8everything Peon

    Messages:
    16,350
    Likes Received:
    903
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What about password protection OR blocking robots from visiting the page?
     
    8everything, Apr 16, 2007 IP
  4. mark_s

    mark_s Peon

    Messages:
    497
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Sounds good, can you elaborate a little?
     
    mark_s, Apr 16, 2007 IP
  5. pixel_dust

    pixel_dust Peon

    Messages:
    151
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #5
    well you'll have to elaborate a little more on what exactly you're looking for

    basically, you make a javascript function
    I would use an external .js file just to keep things neat (but that's just me)

    the simplest function you could make would look like this:

    function writeThis() {
    document.write('this is where I add whatever I want to say');
    }

    and then when you want to add it to your webpage you'd add this:

    <script type="text/javascript">
    writeThis();
    </script>

    that's the basics
    you can get as complex as you like
    you can even make javascript embed html code dynamically
    you could put your whole damn web page in a document.write function if you wanted to
    (but this is a bad idea, I wouldn't suggest it) but it IS possible

    as an example, I've used the document.write function to embed flash movies into an html page while still adhering to strict xhtml
    which isn't possible otherwise
    it can used as a useful work-around for many code issues

    I hope this helps


    vanessa.
     
    pixel_dust, Apr 16, 2007 IP
  6. mark_s

    mark_s Peon

    Messages:
    497
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thank you, that's very helpful indeed.
     
    mark_s, Apr 16, 2007 IP
  7. bobby9101

    bobby9101 Peon

    Messages:
    3,292
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #7
    in css using display:none, is not cloaking by SEO standards
     
    bobby9101, Apr 16, 2007 IP
  8. EGS

    EGS Notable Member

    Messages:
    6,078
    Likes Received:
    438
    Best Answers:
    0
    Trophy Points:
    290
    #8
    JavaScript and DHTML are SEO-friendly ways of hiding content.
    Don't do it using CSS or HTML, EVER, or you will be penalized.

    PHP and other programming languages are good too.
    Databases are probably the best. =P
     
    EGS, Apr 16, 2007 IP
    MaryMary likes this.
  9. bobby9101

    bobby9101 Peon

    Messages:
    3,292
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Show me proof on your CSS/HTML findings.
    Also, why would you store it php or a database? He wants it on page, yet hidden (if I read right)
     
    bobby9101, Apr 16, 2007 IP
  10. mark_s

    mark_s Peon

    Messages:
    497
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #10
    My proof is that my site got penalised by Google and the only thing I was doing wrong was hiding content with CSS.

    It's quite simple.... Google sees the content, the user doesn't, that breaches the guidelines.
     
    mark_s, Apr 17, 2007 IP
  11. bobby9101

    bobby9101 Peon

    Messages:
    3,292
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #11
    THere are legitimate reasons to hide content, feel free to ask matt cutts about it
     
    bobby9101, Apr 17, 2007 IP
  12. mark_s

    mark_s Peon

    Messages:
    497
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Absolutely, as I mentioned in my post above, my reason was legimate but the method I used won't be seen as such.

    Using CSS to hide content, not design elements, will make Google think you're cloaking regardless of your motives.
     
    mark_s, Apr 17, 2007 IP
  13. Valve-Hosting

    Valve-Hosting Peon

    Messages:
    1,071
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Valve-Hosting, Apr 17, 2007 IP
  14. EGS

    EGS Notable Member

    Messages:
    6,078
    Likes Received:
    438
    Best Answers:
    0
    Trophy Points:
    290
    #14
    Because you fool with the click of a mouse PHP can pull the data right from the database to display it, thus it won't be hidden.

    However, hiding your content with JavaScript or PHP won't be viewable by bots, as there is no way to hide content from just the visitors and not the bots (if you're trying to do this for search engines) without being penalized.
     
    EGS, Apr 17, 2007 IP
    AGS and samantha pia like this.