Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

using include for meta data

Featured Replies

Hi all,

 

For ease of use on a site i have just designed i decided to use a php include for the meta data, so each page on the site has the same meta info (keywords, and description).

Each page title is still unique.

 

By doing this will i suffer in the SEO world?

You shouldn't suffer at all.

 

The search engines read the final outputted HTML that the browser sees, including meta-data just creates different meta-data for each page.

 

I do a similar thing on some of my sites (gather the meta-data from a database) using Coldfusion and it seems to work fine.

including meta-data just creates different meta-data for each page.

Not if you're including the same meta data on every page: it will be the same!

 

I recommend against having the same description & keywords on every page.

  • Author
Not if you're including the same meta data on every page: it will be the same!

 

I recommend against having the same description & keywords on every page.

 

see now thats what i was concerned about.

 

I have the keywords and the description held within the include - so yes, they are the same on every page, just the title's are unique.

 

So, are you saying that i should not have 'site wide' keywords and description, and instead tailor them to each specific page?

 

If thats the case i can already see how that would benefit, for example having 'contact' within the keywords and description for the contact page would be a good idea... at least i think... :rolleyes:

Yes, that's exactly what I'm saying.

 

Personally, when I code up a site (that's not being powered by a CMS) I use an include for all the header info - doctype, html tag, meta tags etc - but I use php to echo the value of some of them via variables. I then set the variables on each page. (That sounds more complicated than it is..) E.g. the header would be something like..

 

DOCTYPE HERE
<html>
<head>
<title><?php if (isset($subtitle)) echo $subtitle . " - "; ?>MAIN TITLE</title>

<meta name="keywords" content="<?php if (isset($keywords)) echo $keywords; else echo 'DEFAULT KEYWORDS'; ?>" />

</head>
...etc...

 

and then each page would be:

 

<?php
$subtitle = "about us";
$keywords = "about, bla, foo, bar, etc";
include('header.php');
?>

content here

etc

 

That way I can have a custom title and meta tags/etc for each page by customising the variable each time, but without having to copy and paste the HTML for it all over and over. Does that make sense?

  • Author
Yes, that's exactly what I'm saying.

 

Personally, when I code up a site (that's not being powered by a CMS) I use an include for all the header info - doctype, html tag, meta tags etc - but I use php to echo the value of some of them via variables. I then set the variables on each page. (That sounds more complicated than it is..) E.g. the header would be something like..

 

DOCTYPE HERE
<html>
<head>
<title><?php if (isset($subtitle)) echo $subtitle . " - "; ?>MAIN TITLE</title>

<meta name="keywords" content="<?php if (isset($keywords)) echo $keywords; else echo 'DEFAULT KEYWORDS'; ?>" />

</head>
...etc...

 

and then each page would be:

 

<?php
$subtitle = "about us";
$keywords = "about, bla, foo, bar, etc";
include('header.php');
?>

content here

etc

 

That way I can have a custom title and meta tags/etc for each page by customising the variable each time, but without having to copy and paste the HTML for it all over and over. Does that make sense?

 

 

That makes perfect sense!

I've never thought about doing that... thanks very much, i think i'll adopt that into my site designs if you don't mind :)

  • Jo 90 locked this topic
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.