473,379 Members | 1,491 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 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");
  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
4 2762
JKing
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
mfaisalwarraich
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
Atli
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

2
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...
8
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...
1
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>...
37
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...
1
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. ...
1
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: ...
2
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...
4
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" ...
0
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-...
2
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.