View Single Post
  #1  
Old 04-17-2010, 09:49 PM
  gallaghersean's Avatar 
gallaghersean gallaghersean is offline
 

Advanced Member
  
Join Date: Aug 2008
Location: Clearwater, FL
Posts: 52
 

Default Here is How to Change Page Title Tag Format (remove "::")

I figure I'd pass this along for anyone else wanting to know how to do this. If you want to change the format of the default :: character separator follow these instructions.

I don't know why X-Cart choose a double colon for a separator in their title tags it does not make much sense SEO-wise. The best format for the title tag is: Product Name - Category | Site Name. That is the best format for search engine according to current studies (reference: Best SEO Practices by SEOmoz).

So now on to the details... to change the format follow these steps:

For Page Titles like this: Product Name - Category - Site Name
  1. Open up the file include/templater/plugins/function.get_title.php
  2. Go to line 107.
  3. On this line you will find implode(' :: ', $tmp))); at the end of the line of code change the :: out for the - character or whatever you want. Now this will make your title tags look like this Product Name - Category - Site Name
For Page Titles like this: Product Name - Category | Site Name
  1. First make sure you have the setting in Main page :: General settings :: SEO options :: Page title format set to Product name :: Category name :: Shop name
  2. Open up the file include/templater/plugins/function.get_title.php
  3. Go to line 107.
  4. Replace that entire line
    $title = str_replace(array("\n", "\r"), array("", ""), trim(implode(' :: ', $tmp)));
    With the following:
    PHP Code:
    ############################################
    # Title Tag Hack By RocketMarketingInc.com #
    ############################################
    $title '';
    $titlePartCount count($tmp);
    $icount 1;
    foreach(
    $tmp as $titlePart)
    {
     if(
    $icount!=1) { $title .= ($icount!=$titlePartCount) ? ' - ' ' | '; }
     
    $title .= $titlePart;
     
    $icount++;
    }
    $title str_replace(array("\n""\r"), array(""""), trim($title)); 
That should do it! If you have any questions let me know.
And if you need any other help with SEO on your site feel free to contact me at RocketMarketingInc.com or the contact link in my sig.
__________________
.

Contact me about modifying x-cart for your needs.

Xcart Gold versions:
4.5.x, 4.4.3, 4.4.1, 4.4.0, 4.3.1
4.1.10, 4.1.9, 4.1.8

Add-on modules:

Featured Product Carousel
and other various mods I've built
Reply With Quote