How to auto generate a unique meta description?
-
The site I am working on is a code nightmare for starters. I'm editing a file called layout that controls the section of each page. The programmer from a while back got unique titles by putting this piece of code in:
<title><?= $this->metaTag ?></title>
In all the different controllers and stuff I can see where the title is the name of the product plus review or something to that effect.
How do I do this for the meta description? Right now the meta description is static in the layout file, and so every page has an identical one. I was hoping there was a way to make the meta description automatically use the first 140 characters on the page or something. Something like this:
-
Perfect!
Glad to hear it's all fixed
-
This worked like a charm! The site is on something called Zend cart I think and I had to sort through several Controllers but eventually found all the metaTag stuff in there and added a metaDesc variable next to them, unique meta descriptions on every page! Thanks!
-
Hi Daniel,
The first thing you need to do is to find the definition of the container that “this” is built out of and then add an element called metaDescription.
This will create an empty string until you populate it elsewhere.
Now where you want metaDescription shown, you just use
<title><?= $this->metaDescription ?></title> (replace metaTag with metaDescription).
Next, you need to search your code for the place where metaTag is assigned and add an assignment for metaDescription which can be whatever you want it to be ie a substring etc.
Hope that helps,
Sha
-
I just did a large 5k page website with the same kind of auto generation, It worked very well. I'm not sure how your website is setup and if the content is all on the database but ours is and we just had to fill in some variables like this.
<title><?=ucfirst($ctar[county_name]);?> Jail, <?=$star[state_name];?> | Bail Bonds & Lawyer Resources</title>
Most likely you are looking for something like strip tags.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Tool to identify if meta description are showing?
Hi we have a Ecommerce client with 1000s of meta descriptions, we have noticed that some meta descriptions are not showing properly, we want to pull and see which ones are showing on Google SERP results. You can use tools like screaming frog to pull meta description from page, but we want to see if it's showing for certain keywords. Any ideas on how to automate this? Cheers.
Intermediate & Advanced SEO | | brianna00 -
Part of my site does not show the correct Meta title
Hi our website meta title on the directory section is showing the same title, it does not show the page title. We have tried turning off all plugins, reinstalling the theme, creating a new htacces file. installing Yoast, and testing with All in one seo but still the same thing happens. Tried different themes with the same results But when we test with Twenty Thirteen it is ok Completely lost and would love some help Thanks in advance
Intermediate & Advanced SEO | | Taiger0 -
How should be a perfect SEO Title, Description, H1 and H2?
Hello friends, i have a very good question. In a website of coupon codes, how should be a perfect Title, Description, H1 and H2? For example: If our main keyword is "Promo codes Amazon" but we we want to get good results with "Coupon codes Amazon", "Discounts Amazon" and "Coupons Amazon", how should be a perfect SEO? In some sites, people we use some tactics like month or year in title and descriptions or number of coupons and offers. Thanks so much.
Intermediate & Advanced SEO | | pompero990 -
SERP display switching between normal meta description and 15+ items
The site, www.myrtlebeach.com has been having an issue with the way it displays in search results for the keyword "Myrtle Beach hotels". It is showing as a bulleted/itemized list similar to what's mentioned in this Moz article I'll begin with a little background. When I started working with the site it would display in SERPs as: Myrtle Beach Hotels - Reviews, Deals, & Photos - MyrtleBeach.com
Intermediate & Advanced SEO | | Fuel
www.myrtlebeach.com/hotels/
70+ items - Compare Lowest rates & see reviews on Myrtle Beach Hotels
from $76. Holiday Inn Club Vacations Myrtle Beach - South Beach offers a ...
from $27. Located among the south end Myrtle Beach hotels, Holiday Sands ... We did not want the site showing as an itemized list with 70+ items. We wanted it to show with the meta description we provided.
Our first attempt at getting the SERP to display our normal meta description was to simply change the meta description. That didn't work. Our second thought was to use pagination to reduce the number of items on the page. A few days after we implemented pagination we saw our normal meta description displaying in the SERP. Shortly after that we saw the SERP had reverted, but this time was showing 15+ items rather than 70+. This is when began seeing the SERP display change between a normal meta description and 15+ items. In another effort to stop the 15+ items from displaying in SERPs, we added relevant blog content like "Top 10 Oceanfront hotels" and "Best Kid Friendly Hotels" to break up the hotel listings on http://www.myrtlebeach.com/hotels/. Again, our normal meta description displayed in the SERPs for the next few days, but shortly after reverted back to 15+ items. Since then we have been seeing the SERP switch between our normal meta description and 15+ items with no rhyme or reason. Because our listings are not using , I'm not really sure why the site would be displaying this way. Since I have been regularly monitoring the SERP for the keyword "Myrtle Beach hotels", myrtlebeach.com/hotels/ has ranked as high as 5 and as low as 10. I open an Incognito Window and I take screenshots almost daily. I then record how the site was displayed in the SERP and its rank. I also look at organic visits and a Value Per Entry metric I've created. (I looked at Value Per Entry to determine if someone seeing 15+ items was more apt to convert) Average Visits on days with a normal meta description - 182
Average Visits on days with itemized 15+ description - 174 Average Value Per Entry on days with a normal meta description - 131
Average Value Per Entry on days with itemized 15+ description - 120 Average Rank on days with a normal meta description - 7
Average Rank on days with itemized 15+ description - 6 This data shows that performance is better on days when the normal meta description is displayed regardless of rank. I have linked 2 screenshots for reference. The 2-6-14 screenshot shows the SERP display with 15+ items and the 2-7-14 screenshot shows the SERP display with the normal meta description we provided. My questions are:
1. How does Google determine if a site should display in SERPs with an itemized or bulleted list?
2. Is there something else I need to change on myrtlebeach.com/hotels/ to prevent it from displaying in SERPs with 15+ items? m4znToY PRdDXZf0 -
Not alt tags but Title and description Meta: My designer's answer.
Hello! I was busy doing lots of key wording for my images which I hate and notices that when viewed in source code, the different places I inputed information translated into Title and Description meta tags but NO alt tags. As I'm a a photographer, it's really important to me that I make the most of my images to get increased traffic so I challenged the people behind my website about it. This is their response to the question: "We all know how important the alt tags are for image SEO so why does
Intermediate & Advanced SEO | | IoanSaid
the design allows Title, Description and Keyword image tags but not alt
tags?" Unfortunately, there is no way to add an alt tag and title tag specifically to an image display page. However, as you have pointed out here, we use other elements that essentially accomplish the same thing. Each image display page does have its own page title and meta description, as you have also noticed. For the title, we use the IPTC Headline field (if there is no headline, then we use IPTC Title, and if there is no title, then we go to file name), and for the meta description, we use both the IPTC caption as well as the keywords - so all of that information is embedded on the image display page with the image itself and search engines can index this content. Alt Text data intends to given contextual information to search engines when they crawl your site, and the IPTC metadata that shows along with your images, does this as well." What is your opinion on that answer?0 -
Changing meta title dynamically e.g. with number of reviews in title. Is this a problem?
I would like to put the number of reviews in the meta title of a product page. I noticed that tripadvisor for example does the same. However I read in some places that people encountered problems with frequent title tag changes. Did you ever encounter problems by just changing numbers in title tag?
Intermediate & Advanced SEO | | lcourse
Do you think it is really a problem if just the number of the reviews changes? what about putting number of reviews in the meta description instead?0 -
Help with Effective Meta Description
Can someone give me a sample of an effective meta description tag? All of the best practice stuff I read doesn't talk about how to raise CTR. It seems to me that this is a neglected area of SEO, and we want to do this right. Obviously, we will need to test. For example, my main home page keyword is "IT Support" Things I might want to put in the tag: Free Network Assessments 100% Risk Free Trials "Relentless IT Support" (Major Theme) 30 Years of Experience (since 1984) Eliminate your IT Support Headaches Forever (Too long) Call to action? BTW, Thanks to everyone for your help. This is a great community. Solid advice from experts. Here's an example of what I would create Relentless IT Support Since 1984. Trust and Accountability. 100% Risk Free Trials. Contact us today for Free IT Assessment.
Intermediate & Advanced SEO | | CsmBill0 -
Canonical Meta Tag
Can someone explain how this works and how necessary is it? For example, I have a new client, who is ranking WITHOUT the www in their domain, but they have a good deal of backlinks already that have www in it. When I set up google webmaster tools I made 2, one for WWW and one for WITHOUT and there are diffenet numbers of backlinks for each. I have no idea what do about this or if I should even do anything. Thanks
Intermediate & Advanced SEO | | TheGrid0