homepage Welcome to WebmasterWorld Guest from 204.236.255.69
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Google / Google SEO News and Discussion
Forum Library, Charter, Moderators: Robert Charlton & aakk9999 & brotherhood of lan & goodroi

Google SEO News and Discussion Forum

    
Is it OK for meta tags to be in include files?
a_chameleon




msg:3534928
 3:02 am on Dec 26, 2007 (gmt 0)

.
The entire section of my website, from <head> to </head> is
defined/rendered by an include file.

My <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> etc.
tags are built into this include file, and so is my
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> tag,
and the site's CSS links, as well.

Are there any Google indexing risks associated with doing this?
.

 

tedster




msg:3534934
 3:25 am on Dec 26, 2007 (gmt 0)

Include files are "included" by your server - it happens behind the scene, so to speak. So when your server replies to a request for a url, it sends back the "completed" html file, already fully built with all the includes present.

No user-agent (and that means googlebot, other spiders, and all browsers) sees anything but the final version of the html document, so there is nothing to worry about except being sure you've included everything that you want/need to be there for each url.

Marcia




msg:3534940
 4:18 am on Dec 26, 2007 (gmt 0)

The entire section of my website, from <head> to </head> is
defined/rendered by an include file.
My <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> etc.
tags are built into this include file, and so is my
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> tag,
and the site's CSS links, as well.

As tedster's already explained, it's A-OK, with an exception worth taking note of.

Are there any Google indexing risks associated with doing this?

You have "noindex,nofollow" in your robots meta tag, so if you don't want the pages indexed, it's fine as is.

BUT... in the event you would do that on pages you DO want indexed and ranking, there would be an issue because all of your page title elements and meta descriptions would all be the same across all the pages you're including it on. That is a problem, you'll run into a filter by doing that.

In the event you ever do it on pages you do want indexed, assuming you're using PHP includes, you would have to use a PHP $variable for the content of the page title and meta description, and either assign the value of those variables in some PHP code at the very beginning of the document, for each page, or sniff out the page's filename and "call" those variables, using some PHP logic, from a file with an array or a database (flatfile or MySQL) that includes fields for the page's URL identifiers and the corresponding page title and meta description text for those pages.

Another thing, aside from those issues: also include the DOCTYPE declaration if you use an include for top of page.

Ann4SEO




msg:3535476
 5:15 am on Dec 27, 2007 (gmt 0)

Hello,

As Tedster & Marcia had already replied, I would just like to give my two cents of suggestion.

Include with the header information is good only when you don't want to have those web pages in search engine result pages(SERPs). As you mentioned it is nofollow & noindex that implies that you don't want any search engine bot to crawl your web pages.

But if your planning to get you web pages in SERP, then remove the above tag. Regarding title & meta tags, a include will let you have a common title & meta tags for all your web pages which is not so good for SEO.

To have unique title & meta tags for web pages don't have them in a include file.

Marcia




msg:3535512
 6:45 am on Dec 27, 2007 (gmt 0)

Sure you can have them in an include file and still have them unique for each page. You just have to use a PHP variable for the value of the title or description.

I explained in the previous post how it's done, and it's no problem at all with indexing because the variable is replaced with the proper text for the page by PHP when it's processed server side, before the page is ever served to a user agent.

In the event you ever do it on pages you do want indexed, assuming you're using PHP includes, you would have to use a PHP $variable for the content of the page title and meta description, and either assign the value of those variables in some PHP code at the very beginning of the document, for each page, or sniff out the page's filename and "call" those variables, using some PHP logic, from a file with an array or a database (flatfile or MySQL) that includes fields for the page's URL identifiers and the corresponding page title and meta description text for those pages.

To have them unique, at the very top of the page, first thing, before even the DOCTYPE declaration, you put:

<?php
$title="What the title will say.";
$description="What the meta description will say.";
$keywords="meta keywords here if you use them";
// Other variables you need
?>

To include what's between the head tags:
indlude ("/includes/header.php");

And what's in the include for those will look like this:

<title><?php echo $title;?></title>
<meta name="description" content="<?php echo $description;?>">
<meta name="keywords" content="<?php echo $keywords;?>">

You could even put the entire page into the include, all the way up until the <body> tag.

[edited by: Marcia at 7:06 am (utc) on Dec. 27, 2007]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Google / Google SEO News and Discussion
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved