Page 1 of 1

Question for SEO optimisation

Posted: Thu Aug 18, 2011 5:07 am
by lovac24
Hallo,

how i can add a suffix to the <title> tag on product pages. so that the text appears only withingthe <title> tags in the <head> of product pages but not in the actual product titles themselves.

Thank You

Re: Question for SEO optimisation

Posted: Thu Aug 18, 2011 5:17 am
by uksitebuilder
Will the suffix be the same for all product pages or different for each product ?

Re: Question for SEO optimisation

Posted: Sat Aug 20, 2011 10:10 am
by hellogoodbye
I would like to know where/how to add text to the browser title, but not the product itself too. the same to each page is fine..

Re: Question for SEO optimisation

Posted: Sat Aug 20, 2011 3:25 pm
by uksitebuilder
open: catalog/view/theme/default/template/common/header.tpl

find:

Code: Select all

<title><?php echo $title; ?></title>
replace with:

Code: Select all

<title><?php echo $title . (isset($this->request->get['route'])&&$this->request->get['route']!='product/product'?' - WHATEVER YOU WANT'); ?></title>
OR If you just want to append the site name:

replace with:

Code: Select all

<title><?php echo $title . (isset($this->request->get['route'])&&$this->request->get['route']!='common/home'&&$this->request->get['route']!='product/product'?' - ' . $this->config->get('config_name'):''); ?></title>

Re: Question for SEO optimisation

Posted: Sat Aug 20, 2011 5:36 pm
by lovac24
uksitebuilder wrote:Will the suffix be the same for all product pages or different for each product ?
I want to make it different for every product. So please can you tell me where to change it? Thank You

Re: Question for SEO optimisation

Posted: Sat Aug 20, 2011 9:18 pm
by uksitebuilder
Do you use the 'Location' field in your edit product screen for anything ?

If not you could put the unique text in there.

Then we just need to append it to the title on the product page.

Re: Question for SEO optimisation

Posted: Sun Aug 21, 2011 6:53 am
by hellogoodbye
When I replace the code below, the homepage's browser title shows "Notice: Undefined index: route in..."
and nothing changes on the product pages.

Code: Select all

<title><?php echo $title; if($this->request->get['route']!='product/product'){ echo ' - WHATEVER YOU WANT'; } ?></title>
And nothing happens (no errors either) when I change it to the one below.

Code: Select all

<title><?php echo $title . (isset($this->request->get['route'])&&$this->request->get['route']!='common/home'&&$this->request->get['route']!='product/product'?' - ' . $this->config->get('config_name'):''); ?></title>

Re: Question for SEO optimisation

Posted: Sun Aug 21, 2011 2:32 pm
by uksitebuilder
OK, I changed one code block, but forgot the other, apologies, I have amended my code above.

You asked, for the title to be appended if not on the product page, or did I misunderstand your question ?

Re: Question for SEO optimisation

Posted: Mon Aug 22, 2011 3:16 am
by hellogoodbye
Yes, I wanted to add some extra text to the title (the one on the web browser), but not to the product title on the webpage. I wanted to use the first code you gave. Tried it again and the site doesn't load. It's a blank page this time.

Re: Question for SEO optimisation

Posted: Mon Aug 22, 2011 3:26 am
by uksitebuilder
ahh ok, not sure why you are getting a blank page.

So if I have this correct, you want to append a phrase to the META title on all pages including the product page (the browser page title). I misunderstood before and thought you meant all pages apart from the product pages.

If so, then, try this code. I have actually just done the same for my sites by appending the site name to the title, but you can use any phrase.

find:

Code: Select all

<title><?php echo $title; ?></title>
replace with:

Code: Select all

<title><?php echo $title . ' - WHATEVER YOU WANT'; ?></title>

Re: Question for SEO optimisation

Posted: Mon Aug 22, 2011 9:58 am
by hellogoodbye
aha yes, i want to append a phrase to the meta title of the product pages. Thanks! It works. How do I exclude the homepage from getting appended?

Re: Question for SEO optimisation

Posted: Mon Aug 22, 2011 2:50 pm
by uksitebuilder

Code: Select all

<title><?php echo $title . (isset($this->request->get['route'])&&$this->request->get['route']!='common/home'?' - WHATEVER YOU WANT':''); ?></title>

Re: Question for SEO optimisation

Posted: Mon Aug 22, 2011 5:04 pm
by hellogoodbye
ohh, am I getting a blank page because the seo_url.php was edited?

Re: Question for SEO optimisation

Posted: Mon Aug 22, 2011 5:19 pm
by uksitebuilder
do you get a blank page without the code change above ?

are there any errors in your admin error log ?

Re: Question for SEO optimisation

Posted: Tue Aug 23, 2011 4:23 am
by hellogoodbye
Just tried the code again and it works. My bad, I must have left out the

Code: Select all

':''
while editing my keyword. Thank you for ur help!

Re: Question for SEO optimisation

Posted: Wed Aug 24, 2011 8:43 pm
by lovac24
uksitebuilder wrote:Do you use the 'Location' field in your edit product screen for anything ?

If not you could put the unique text in there.

Then we just need to append it to the title on the product page.
I am not using the location field and i leave it always blank.