472,377 Members | 1,524 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,377 software developers and data experts.

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

194 100+
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");
  5. if($_REQUEST['page']=='mypage')
  6. {
  7. then include meta tags according to the page name from the database.
  8. }
  9. ?>
  10. </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.
Dec 2 '10 #1
4 2693
1,206 Expert 1GB
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
194 100+
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
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
5,058 Expert 4TB
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

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

Similar topics

by: sams | last post by:
How do I make or workaround in my Apache server to parse *.html files for <?php ?> code embedded in it? Currently php recognises <?php ?> tag only if the file has a *.php extension. Any php...
by: Frances Del Rio | last post by:
can u put JS code inside a frameset? I have this, and it's not working, even test alerts are ignored, in both browsers.. thank you.. Frances Del Rio <frameset rows="90,*" border=0...
by: Bennett Haselton | last post by:
If I have this code for repeater, it gives a compilation error saying "The type or namespace name 'MyValue2' could not be found": <asp:Repeater id="MyList" runat="server"> <ItemTemplate>...
by: Alan Silver | last post by:
Hello, Newbie here, so please forgive what is probably a basic question ... I see a lot of discussion about "code behind", which if I have understood correctly, means that the script code goes...
by: Kevin | last post by:
How do I include mb.html if I check file is existed? I'm assuming I do this in codebehind, but how? Basically if the file exists, it should display the page that will include mb.html. ...
by: Daniel Andrade | last post by:
Hello, How can I write a C# code inside a javascript code, before body tag, as we wrote in classic asp? (I have a code file separated with a lot of C# code) I would like anything like this: ...
by: pratibharaut | last post by:
Hello friends, I am trying to make XHTML pages with PHP . But when i write the php code it doesnt work. It works for plain XHTML. For run that pages i am using WAP Proof software. The code...
by: rathiagu | last post by:
I am working in c#.net (2.0 version).I am calling a ajava applet code inside my .aspx page. the code is below <APPLET code="com.crc.console.ConsoleApplet.class" archive="../nbr/crc-signed.jar" ...
by: Allen | last post by:
Hi Everybody, I would appreciate it if you can give me a hand here. I want to use the two codes, below, together to do the following when the "IN" button is clicked (InBtn_Click):- 1-...
by: sirius | last post by:
Is is possible to execute php code inside an html page on IIS. ? I have PHP running and my scripts with .php extention execute fine, but I can't seem to get my php code to run when embeded inside an...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.