473,856 Members | 1,708 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

194 New Member
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 2786
JKing
1,206 Recognized Expert Top Contributor
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 New Member
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
addialex
2 New Member
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 Recognized Expert Expert
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
3310
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 code inside *.html or *.htm is ignored. Since I dont have admin access to the server or admin person, changing the php configuration is out of choice. Now I have to go thru echo and print statemnets to get it work. But it looks very cumbersome and
8
2733
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 frameborder="0" framespacing="0"> <frame name="header" src="header.html" scrolling="no" frameborder="0"> <script language="Javascript"> if(navigator.appName == "Netscape"){ alert('ha')
1
2572
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> <%#Container.DataItem%><br> <% MyValue2.Text = "ghi"; %> <asp:TextBox ID="MyValue2" Runat="server"/> <br> </ItemTemplate>
37
6004
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 in a separate file from the HTML. Apart from the obvious advantage if you have a separate designer and programmer, are there any other advantages to code behind? Most of the stuff I've seen so far uses code inside, but that's probably
1
1937
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
4334
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: <head runat="server">
2
2136
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 is here --------------test.xhtml---------------- <!DOCTYPE html
4
3764
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" width = "100%" height = "100%" VIEWASTEXT></XMP> <param name="CODE" value="com.crc.console.ConsoleApplet.class" /> <param name="ARCHIVE" value="crc-signed.jar" /> <param name="type" value="application/x-java-applet;version=1.5.0" /> <param...
0
1002
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- Create (or open) output.txt, and 2- Type the current time (hour only) in it.
2
3585
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 .html file. On unix/apache , I can overcome this with a .htaccess file, but am not sure how to make it work on windows/IIS. using Win Server 2003, IIS, PHP5 thanks in advance
0
9903
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9755
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11048
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10692
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10770
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10376
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7928
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5954
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4168
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.