By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,322 Members | 551 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,322 IT Pros & Developers. It's quick & easy.

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

100+
P: 194
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
Expand|Select|Wrap|Line Numbers
  1. <head>
  2. <?php
  3. include("includes/functions.php");
  4.  
  5. if($_REQUEST['page']=='mypage')
  6. {
  7. then include meta tags according to the page name from the database.
  8. }
  9. ?>
  10. </head>
  11.  
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.
Dec 2 '10 #1
Share this Question
Share on Google+
4 Replies

JKing
Expert 100+
P: 1,206
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?
Dec 2 '10 #2

100+
P: 194
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.
Dec 7 '10 #3

P: 2
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.
Dec 17 '15 #4

Atli
Expert 5K+
P: 5,058
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" :)
Dec 22 '15 #5

Post your reply

Sign in to post your reply or Sign up for a free account.