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

Prevent Cruel DeIndexing Technique

Discussion in 'BlackHat Lounge' started by shade, May 16, 2009.

  1. shade

    shade Junior Member

    Joined:
    Jan 1, 2009
    Messages:
    137
    Likes Received:
    179
    Occupation:
    Job? Whats a job?
    Location:
    America
    Home Page:
    I've just noticed this cruel deIndexing technique.

    If you have a web 2.0 site you should watch out for this.

    If you are in certain niches such as things for children and toys having certain 'adult' keywords can drop your page.

    I've noticed that some people (most likely other webmasters) will go onto your site and post a comment that 'subtlety mentions' an adult keyword.

    Example #1:
    Google would crawl your page, notice a keyword density for "children", "child's", "kids", and "toys" and put down that you have a children's site. Then they would notice "adult toys" and you will either be deIndexed or buried very very low in the SERPs.

    I wrote this little script to the top of my pages that prevents this.

    HTML:
    <?php
    $keyword = ""; //your main keyword here!
    
    $userAgent = $_SERVER['HTTP_USER_AGENT'];
    if(stristr($userAgent, "GoogleBot") || (stristr($userAgent, "Google") ||
    stristr($userAgent, "Bot") || stristr($userAgent, "bot") || stristr($userAgent,
    "google")) {
    $page = file_get_contents($_SERVER['PHP_SELF');
    $fh1 = fopen("badwords.txt", 'r');
    $badwords = fread($fh1, filesize("badwords.txt"));
    fclose($fh1);
    $badwords = explode("\n", $badwords);
    $numOfBadwords = count($badwords);
    $var = -1;
    while($var < $numOfBadwords) {
    $var = $var + 1;
    if(stristr($page, $badwords[$var]) {
    str_replace($badwords[$var], $keyword, $page);
    }
    }
    echo $page;
    die();
    }
    
    Edit the top $keyword = ""; line. Put your main keyword in between the double quotes.

    Now make a .txt file named "badwords.txt" that has all the adult keywords in it separated by lines. PUT THIS FILE IN THE SAME FOLDER AS "index.php"!

    Example:

    CHMOD the "badwords.txt" file to to 777.

    VERY IMPORTANT!
    Use robots.txt to disallow GoogleBot from finding badwords.txt

    Now when GoogleBot crawls your page and it has a 'badword' in it it will be changed to your main keyword!

    So instead of being deIndexed, you go further in the SERPs. :arms:

    Cheers
     
    • Thanks Thanks x 2
    Last edited: May 16, 2009
  2. stealthisblog

    stealthisblog Regular Member

    Joined:
    May 26, 2008
    Messages:
    289
    Likes Received:
    238
    Location:
    New York City
    Great script, it should definitely come in handy. That method you spoke of should too ;)
     
  3. klawre1221

    klawre1221 Regular Member

    Joined:
    Feb 16, 2009
    Messages:
    361
    Likes Received:
    59
    yeah I have found out first hand that if you want to sink a competitor fast then post something outlandish on their site.