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.phpto your templates and overrides directory:
/includes/modules/your_template_dir/meta_tags.phpFind 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.
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?
I am getting the same error above, it seems the error in the case statement
case ($this_is_home_page == true):
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.
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
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.
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
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:
Hope that helps.
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
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.
2nd time was a charm …. Thanks
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.
Wow, that works for me on the first try. I will just need to wait for the bots to crawl now 🙂
Please tell me how i can customize my homepage meta descriptions.Im using 1.3.8 version
Thanks,Len
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.
Hi,
My site support 3 languages, please tell me how I can define this parametrs for all languages?
Thanks
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.
Thanks Eric, it’s an excellent article, just what i needed!
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!