Forum Moderators: coopster

Message Too Old, No Replies

PHP meta tagging for SEO

Where to put the meta tag

         

aantozz

12:27 pm on Apr 28, 2011 (gmt 0)

10+ Year Member



Hello,
I'm real new to this and would like your help. My web site is mostly done on php and it does not have the <head></head> on the pages. As an example, one of the pages has this on the top;

<?
include("header.php");
?>
<!--header close-->

<!--middle-->
<div id="middle">
<div id="job">
<div class="left-box">
<h1>Post Project</h1>


The tag file says I should place my content in between the <head></head> but as you see the field does not exist in php.

How can I accomplish the same thing with my site having the above heading?

rainborick

2:13 pm on Apr 28, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The script indicates that the top of the page is contained in the file 'header.php'. That's where you'll find what you're looking for.

aantozz

3:45 pm on Apr 28, 2011 (gmt 0)

10+ Year Member



Thanks for the help. I found the file header.php.

rocknbil

5:32 pm on Apr 28, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Right, but now you may have already seen the next problem, being a single file, you may have static values across the site for title, meta description, and (not so important) meta keywords. What you need to consider is using "placeholders" or even variables in header.php so that those remain unique on each page you output.

StoutFiles

5:47 pm on Apr 28, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If he's just learning about includes he's not going to be using placeholders.

aantozz

6:52 pm on Apr 28, 2011 (gmt 0)

10+ Year Member



Yes all my pages have the same header and footer. The only thing that changes is the middle part of each page and they all reference the header.php file.
I did notice that there are <title> tags on each page though so I can place the titles with no problem but I don't know if this helps in SEO.

g1smd

6:56 pm on Apr 28, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Every page should have a unique title and unique meta description.
You can ignore the meta keywords element.