Is it bad for SEO to put PHP code inside the head tag?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mfaisalwarraich
    New Member
    • Oct 2007
    • 194

    Is it bad for SEO to put PHP code inside the head tag?

    Hi Everyone,

    I have some problem with SEO expert while arguing about PHP Code and Head tag.

    I have included some PHP Code inside head tag like
    Code:
    <head>
    <?php
    include("includes/functions.php");
    
    if($_REQUEST['page']=='mypage')
    {
    then include meta tags according to the page name from the database.
    }
    ?>
    </head>
    This is a CMS website and i have provided controls to add meta info at the admin panel of the website.

    Now SEO expert is not happy with this as he is still insisting to remove any PHP code inside head tag of page. As i know Google Spider or Bot crawls rendered pages not PHP Code but im not able to give any reference to him. I have read Google Webmaster section and i did not found anything related to this issue.

    My question is should i remove PHP code from inside of <head> tag?

    Please advise me what should be the solution of this problem/issue.

    Thanking you.
  • JKing
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    I am with you on this one. The php tags should have no effect on SEO unless you are printing something that shouldn't be there. As far as spiders and bots go they do not see the server side code.

    Does the SEO "expert" give a reason as to why they shouldn't be there?

    Comment

    • mfaisalwarraich
      New Member
      • Oct 2007
      • 194

      #3
      No, SEO "expert" never gave me any reason just kept asking me to remove any PHP code from inside of <head> tag. But now SEO "expert" agreed with me as i showed him your answer and he realized that Server Side Code can't be viewed by a BOT / Crawler.

      Thank you for your reply.

      Comment

      • addialex
        New Member
        • Dec 2015
        • 2

        #4
        according the search engine head tag is most important for the seo activity,so that most of the seo experts put site's title in the head tag.

        Comment

        • Atli
          Recognized Expert Expert
          • Nov 2006
          • 5062

          #5
          It's worth pointing out, in this context, that most serious WordPress based sites use various SEO plugins to manage things like SEO related meta tags, which all happens through PHP code.

          Just in case anybody ever needs something to point at, to shoot down this kind of nonsense from incompetent SEO "experts" :)

          Comment

          Working...