Jump to content

How do I change dynamic meta tags?


Icoste

Recommended Posts

hi, my site has been optimized for each of my products automatically. The problem Im having is that i need to change this.

 

Currently, my "meta title" is the "title of my product" and the "meta description" is the "description of my product".

 

If no title or description is available for my product the meta titla and description is:

 

Title: Icoste.com - Price Comparison UK - Compare Millions Of Prices

 

Description: Price Comparison - Compare millions of products from thousands of websites to find the best price!

 

My current metatag info is:

 

<title><?=$pageTitle==""?"Icoste.com - Price Comparison UK - Compare Millions Of Prices":$pageTitle?></title>

<meta name="keywords" content="<?=$pageKeyWords==""?"Icoste, online shopping, compare prices, shopping, price comparison, baby products, body care, books, cars, clothing, mobile phones, computers, electronics, games, sport, music, office, tickets, travel, video & DVD":$pageKeyWords?>">

<meta name="description" content="<?=$pageDescription==""?"Price Comparison - Compare millions of products from thousands of websites to find the best price!":$pageDescription?>">

 

 

I want to be able to change my titles and descriptions so that they show:

 

Title: Icoste Price Comparison - (the product title)

 

Description: Icoste Compare Prices - (product description)

 

...instead of...

 

Title: (the product title)

 

Description: (product description)

 

 

If anyone can point me in the right direction it would be great, i have been racking my brains!

 

Many thanks

Link to comment
https://forums.phpfreaks.com/topic/48930-how-do-i-change-dynamic-meta-tags/
Share on other sites

variables are words preceded by a dollar sign such as $pagetitle.

 

If you want to change the position of this and/or surrounding text...just move it.

 

<title>
<?php
if($pageTitle=="")
{
   $pageTitle = "Icoste.com - Price Comparison UK - Compare Millions Of Prices";
}
else
{
   $pageTitle = "Icoste Price Comparison - ($pageTitle)";
}

echo $pageTitle;

?>
</title>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.