Php code for no index no follow

Discussion in 'PHP' started by Dee2007, Nov 16, 2012.

  1. #1
    Hi

    Does anyone know the correct php code for noindex, no follow, I know how to add it to a normal html page, but I need to add it directly to a couple of php file.

    Thanks in advance

    Dee
     
    Dee2007, Nov 16, 2012 IP
  2. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #2
    
    echo '<meta name="robots" content="noindex, nofollow" />';
    
    PHP:
    you can't do it directly with php
     
    stephan2307, Nov 16, 2012 IP
  3. Dee2007

    Dee2007 Active Member

    Messages:
    1,185
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    88
    #3
    Thanks :) Does it matter where in the php file I place it?
     
    Dee2007, Nov 16, 2012 IP
  4. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #4
    i think in the <HEAD> section of your HTML code? did you try to find it out for your selve? or was it faster to ask the question?
     
    EricBruggema, Nov 16, 2012 IP
  5. Dee2007

    Dee2007 Active Member

    Messages:
    1,185
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    88
    #5
    Yes I did try to find out how to do it myself, I always do before asking!

    There is no HTML in the file it is all PHP code.
     
    Dee2007, Nov 17, 2012 IP
  6. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #6
    and you call the php code directly? then on the first line :)
     
    EricBruggema, Nov 17, 2012 IP