PHP: Creating Custom Title and Meta (Simple Way)

In this article we will learn how to create custom title and meta description for each pages of you website. If you’re using WordPress or script that already have this standard SEO settings, all title and meta can be done setup in easy way. Anyway how if your website using your own design? I mean you designed it from zero! some of us didn’t notice if actually we are using global title and meta that was caused search engine didn’t give good result in return because all categorized as “duplicated“.

ist-false

*sample on false title and meta making my site poor in keyword.

Yup, duplicated but actually it’s not duplicated because it’s our false didn’t give clearly information to crawl robots. I will give example using my own false sites www.nexmutk.com after long long time ago, I didn’t optimized this website because I’m stuck and have no idea on how to optimize it. But after learn and learn now I know that I was doing something wrong because I didn’t give right title and meta for each pages (I used global, poor me).

My website using global header.php so all title and meta are same for each page, Now I understand I must change this to get better result in return to my pages. Let’s try to make it…..

First I created file name config.php then I write inside it (this is sample):

<?php

$titledownload = ‘Download Area – NexusTK Server Emulator – Atlantia MMORPG Development – Nexmutk.com’;

$descriptiondownload = ‘<META NAME=”DESCRIPTION” CONTENT=”Welcome to download area, you can downloading files for nexustk server, atlantia MMORPG development in here”>’;

$keyworddownload = ‘<META NAME=”KEYWORD” CONTENT=”download nexmutk,download nexustk,download nexustk map editor,download nexustk music,download gunbound server,download darkages server,download lunentia server,download ts online server,download ran online server”>’;

?>

Then I write in header.php to include this files for each time header.php called:

<?php

include(‘config.php’);

$currentpage = $_SERVER[‘REQUEST_URI’];

if($currentpage==”/download.html” || $currentpage==”/download.html” || $currentpage==”” ) {

echo “<title>”.$titledownload.”</title>\n”;

echo “$descriptiondownload\n”;

echo “$keyworddownload\n”;

}

?>

The result is good as I seen in source code, but I’m not sure if this way will make result in search engine better because I need to wait to see if it performs better… Anyway if you’re like to used this simple way you have to repeated each pages to get complex result.. I was thinking to use WordPress if this way fails. he he… enjoy this tips 🙂

Similar Posts:

RELATED SEARCH TERMS:

5 thoughts on “PHP: Creating Custom Title and Meta (Simple Way)”

  1. This way false to give better search engine result, I converted into wordpress. You all welcome to edited this code as long it’s not for commercial.

  2. I believe this is one of the most significant info for me. And i am happy studying your article. However want to commentary on some general things, The site style is ideal, the articles is in point of fact excellent : D. Just right job, cheers

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.