How to Customize Home Page META Descriptions and Why You Should Consider It

Written by  June 2, 2007

I found a question like this in the forums recently, and noticed there have been a number of people asking it. The question asked is “How do I change / customize the META tag description for my Zen Cart home page?

In case you aren’t aware of it, the “default” META description for the home page of your Zen Cart store basically lists the “title” you have given to your site, and then follows that with a list of all the keywords you have entered in your language file. So, what you end up with is something that looks like this:

My Store Name – keyword1, keyword2, keyword3, keyword4, keyword5, etc…

Not very “nice” looking is it? Well, as with all things “conversion” related, the “conversion” process starts from the minute a potential customer views any information about you.

Why is that important?

Well, if you want to increase conversion, you need “qualified visitors”. Qualified visitors come from various sources, one being Organic Search results.If it were “paid search” (PPC) ads we were running, would we pay money for our ad to say something this? I don’t think so (unless you had money to waste and really didn’t care about increasing sales).

So then, why should we settle for our “Organic Search Ad” (because in reality, that IS what you should think of your search listing as) to say it? Well, the answer is we shouldn’t!

Let me put it this way. If you were searching for “cell phones” on the the Internet, and you came across a number of search listings that looked like this (I’ll show just 2 entries as an example):

Cellular Phone Central – We have the best prices on cell phones from LG, Motorola, Samsung and more. Free shipping and calling plans for all orders.

My Cell Phone Store – cell phones, cellular plans, lg, motorola, samsung, phones, calling cards, wireless, verizon

Which would “prompt you” more to click it? The vast majority of Internet users would click the first one as it is more descriptive in nature and tells at least a bit more about what they can expect when they get to the site. It also gives them reason to click by stating a few direct customer focused benefits (very important if you want qualified traffic).

How do you change it?

So having stated that, the question of “how to change your home page META description in Zen Cart” becomes much more important! How you change it as follows:

Copy the file:
/includes/modules/meta_tags.php

to your templates and overrides directory:
/includes/modules/your_template_dir/meta_tags.php

Find this code:
// Get different meta tag values depending on main_page values
switch ($_GET['main_page']) {
case 'advanced_search':

And change to this:

// Get different meta tag values depending on main_page values
switch ($_GET['main_page']) {
case ($this_is_home_page == true):
define('META_TAG_TITLE', 'MY HOME PAGE');
define('META_TAG_DESCRIPTION', 'This meta tag is showing on my immediate home page to my site');
define('META_TAG_KEYWORDS', 'keywords each go here');
break;
case 'advanced_search':

Then edit it to read as you want the tags to read for the Home page.

Thanks to Linda over at the Zen forums for answering this one for everybody.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Related articles other people have read:

Comments

19 Responses to “How to Customize Home Page META Descriptions and Why You Should Consider It”

  1. gb2007 on July 11th, 2007 1:43 am

    Hey I am trying to edit the file as you described but I am getting the error as below. Do you know what might go wrong?

    Parse error: syntax error, unexpected T_STRING in /home/glorscom/public_html/includes/modules/meta_tags.php on line 57

    You said “Then edit it to read as you want the tags to read for the Home page.”. Which part of the code I have to edit exactly? I tried to edit “This meta tag is showing on my immediate home page to my site” or ‘keywords each go here’ but neither works.

    thanks for your help!

  2. econcepts on July 11th, 2007 1:07 pm

    Hey I am trying to edit the file as you described but I am getting the error as below. Do you know what might go wrong?

    Parse error: syntax error, unexpected T_STRING in /home/glorscom/public_html/includes/modules/meta_tags.php on line 57

    You said “Then edit it to read as you want the tags to read for the Home page.”. Which part of the code I have to edit exactly? I tried to edit “This meta tag is showing on my immediate home page to my site” or ‘keywords each go here’ but neither works.

    thanks for your help!

    Check to make sure you typed everything correctly. A “syntax” error means something in the code you altered is not typed correctly (or is missing).

    This could be the case if you copied the code directly from my post into a program that “kept formatting”. You should make sure you first copy it into a straight text editor and then even after that, make sure that all elements are correctly formatted.

    To get the text to show properly on the home page, you would edit in the areas I listed in the original code above. Make sure you have ALL elements in place (and that you are using the most current versions of Zen Cart) in order for this to work.

    The older versions of Zen Cart required a totally different method to get it to work. I should have mentioned that this was for the newer versions of Zen. On older versions, it would look as if nothing occurs even though you may have made changes to the proper file.

    What Zen Cart version are you running on?

  3. AJ on July 11th, 2007 3:57 pm

    I am getting the same error above, it seems the error in the case statement
    case ($this_is_home_page == true):

  4. econcepts on July 11th, 2007 4:26 pm

    AJ,

    Make sure that if you are copying the code as you see it here, you make the needed corrections to the syntax. Things like the the “apostrophes” will need to be changed to meet “text standards”.

    This isn’t always the case, but depending on what system you paste the code into, you may have to change certain characters.

  5. gb2007 on July 11th, 2007 7:57 pm

    econcepts,

    Thanks very much! I got it working now I believe. I did two things and don’t know which one helps: 1) I copied and paste the code from your website as unformatted text into the php file (I am using notepad as editor) 2) give two space before “define” and “case” to align with the rest of codes.

    My next project is to get Google Analytics working and sure will have more questions for you!

    gb2007

  6. econcepts on July 11th, 2007 8:10 pm

    gb2007,

    Glad you got it working. I thought it must be a formatting issue with the copy and paste from the site. I noticed that specifically, the apostrophe’s looked like they “wouldn’t work” (from previous coding experience).

    Also, in light of that, I decided to edit the entry and alter the code to hopefully be more “user friendly” for copy and pasting.

  7. gb2007 on July 15th, 2007 4:18 pm

    Eric,

    After several days, google still shows “Galatea – Bridal Gowns Bridesmaids Evening Dresses Retailers Only Flower Girls ecommerce, open source, shop, online shopping.” when I search “Gloria Bridals”, even I already changed “define(‘META_TAG_DESCRIPTION’, ‘This meta tag is showing on my immediate home page to my site’);” to something else better describe my website. Is this just a timing issue or i still haven’t done it right?

    thanks,
    gb2007

  8. econcepts on July 15th, 2007 9:05 pm

    gb2007,

    If you are talking about what the “search engines” have as your title etc… then the answer is, that takes time to change. Once you have been indexed, you’ll have to wait until the search engines come back and re-index your site in order for the new changes to show. So, that is a timing issue.

    If however you are talking about how the actual page meta description, and page keywords are shown, then that is an immediate change.

    I went to your site and looked at your META keywords and description. They indicate the changes you made are in effect. However, you’ll want to correct the keywords as you have not listed any now. You have the default “your keywords here” in place of it.

    Here is what your code currently looks like:

    meta name=”keywords” content=”keywords each go here”

    meta name=”description” content=” At Gloria Bridals, our retailers enjoy many great services include NO minimum order required, Free customization and fabric swatch samples, 24/7 easy shopping and Flexible payment options. We are proud to present Galatea branded wedding dresses including bridal gowns, bridesmaids, evening dress, quinceanera and flower girls to millions of consumers through our retail partners. ”

    Hope that helps.

  9. Raoul on August 12th, 2007 5:11 am

    I am currently using ZC 1.3.0.2. Where would I need to make the changes that you are referring to. In the /includes/modules/meta_tags.php it refers to /includes/languages/english/meta_tags.php but the tags there don’t seem to reflect what is showing on Google Search.

    Thanks
    Ral

  10. econcepts on August 12th, 2007 7:31 am

    I am currently using ZC 1.3.0.2. Where would I need to make the changes that you are referring to. In the /includes/modules/meta_tags.php it refers to /includes/languages/english/meta_tags.php but the tags there don’t seem to reflect what is showing on Google Search.

    This set of code usually falls around line 54 in the code.

    You can typically find it below the following line of code:


    define('KEYWORDS', str_replace('"','',zen_clean_html($keywords_string_metatags) . CUSTOM_KEYWORDS));

    Your META Tag file should reflect this? It has been in there since early versions of the software.

  11. AJ on August 23rd, 2007 1:56 am

    2nd time was a charm …. Thanks

  12. Wael on December 23rd, 2007 8:59 am

    Thank you for your help, it’s working perfectly fine. I was wondering if it’s possible to modify more pages, if so, how do I do this?
    Thanks again.

  13. tweakservers on December 31st, 2007 3:56 am

    Wow, that works for me on the first try. I will just need to wait for the bots to crawl now 🙂

  14. Len on August 13th, 2008 10:57 pm

    Please tell me how i can customize my homepage meta descriptions.Im using 1.3.8 version

    Thanks,Len

  15. Eric Leuenberger on August 13th, 2008 11:13 pm

    Len,

    If you are using version 1.3.8 you got it real simple. Nothing special to do other than open up the /includes/languages/english/[yourtemplate]/meta_tags.php file and find the section near the top that tells you how to enter your custom home page meta descriptions etc…

    Hope that helps.

  16. Alex on October 26th, 2008 7:12 am

    Hi,
    My site support 3 languages, please tell me how I can define this parametrs for all languages?
    Thanks

  17. Player Profiles on October 30th, 2010 1:45 am

    Maybe you should make changes to the page subject title How to Customize Home Page META Descriptions and Why You Should Consider It : Ecommerce Optimization & Marketing to something more catching for your content you write. I liked the post even so nonetheless.

  18. Labimo on November 8th, 2010 1:17 am

    Thanks Eric, it’s an excellent article, just what i needed!

  19. Karen Isaacson on April 24th, 2011 8:45 pm

    I installed Zen Cart and went through the tutorials on how to change the meta_tags.php file, and could not. I went through five reinstalls to try to make the thing work, but nothing worked until I used your instructions. A week of frustration and banging-head-against-the-wall and people on the Zen forums telling me I had made a mistake was resolved IMMEDIATELY by using this fix.

    Thank you so very much!

Feel free to leave a comment...
and oh, if you want a pic to show with your comment, go get a gravatar!