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.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
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
-
Migrating to WooCommerce, similar product descriptions but with different urls, cant use variations.
Hi! Ime quite new to SEO and to woocommerce so please help out with this one.. We are migrating from Ithemes Exchange over to WooCommerce and i have come up with some issues. We are selling adhesives and some of the products have the same name and description, the only thing that seperates them are sometimes the widht, or the length on the roll.. As we have it now we have a separate product page for each widht and length. For example here http://siga-sverige.se/siga/fentrim-2-100/ and here http://siga-sverige.se/siga/fentrim-2-150/ The above product pages are for a product called Fentrim 2. its availiable in widhts from 75 to 300mm.. so, its six diffent products pages with more or less the same description. I get that this will create duplicate content, couse the description on the pages are similar.. We cant use variations in woocommerce, couse this cant be set up to exactly match our shipping needs, so, we need them on separate pages.. Soo, my plan is to set a new product page for Fentrim 2, ex http://siga-sverige.se/siga/fentrim-2 and then set that url as canonical url for the variations of the product.. Am i on the right track? Gratefull for any help on this one! / Jonas
Intermediate & Advanced SEO | | knubbz1 -
Pull meta descriptions from a website that isn't live anymore
Hi all, we moved a website over to Wordpress 2 months ago. It was using .cfm before, so all of the URLs have changed. We implemented 301 redirects for each page, but we weren't able to copy over any of the meta descriptions. We have an export file which has all of the old web pages. Is there a tool that would allow us to upload the old pages and extract the meta descriptions so that we can get them onto the new website? We use the Yoast SEO plugin which has a bulk meta descriptions editor, so I'm assuming that the easiest/most effective way would be to find a tool that generates some sort of .csv or excel file that we can just copy and paste? Any feedback/suggestions would be awesome, thanks!
Intermediate & Advanced SEO | | georgetsn0 -
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 -
How does the use of Dynamic meta tags effect SEO?
I'm evaluating a new client site which was built buy another design firm. My question is they are dynamically creating meta tags and I'm concerned that it is hurting their SEO. When I view the page source this is what I see. <meta name="<a class="attribute-value">keywords</a>" id="<a class="attribute-value">keywordsGoHere</a>" content="" /> <meta name="<a class="attribute-value">description</a>" id="<a class="attribute-value">descriptionGoesHere</a>" content="" /> <title id="<a class="attribute-value">titleGoesHere</a>">title> To me it looks like the tags are not being added to the page, however the title is showing when you view it in a browser and if use a spider view tool, it sees the title. I'm guess it is being called from a DB. So I'm a little concerned though that the search engines are not really seeing the title and description. I'm not worried about the keywords tag. Can anyone shed some light on how this might work? Why it might not being showing the text for the description in the page code and if that will hurt SEO? Thanks for the help!
Intermediate & Advanced SEO | | BbeS0 -
Meta Keywords Good or Bad
Hi All, I've been reading more about the meta keyword tag and why it may not be a good idea to include them on pages and am looking for thoughts/feedback on this idea. If you have employed this tactic, can you give me some insight into any results you saw. If you decided to not employ this tactic, why did you choose not to? I wan to understand all sides of this before employing any changes to my company's websites. Thank you for your help!
Intermediate & Advanced SEO | | airnwater0 -
How does Google Keywords Tool compile search volume data from auto-suggest terms?
Hi everyone. This question has been nagging at my mind today ever since I had a colleague say "no one ever searches for the term 'presonus 16.4.2'" My argument is "Yes they do." My argument is based on the fact that when you type in 'presonus 16" - Google's auto-suggest lists several options, of which presonus 16.4.2 is one. That being said. Does Google's Keyword Tool base traffic estimates ONLY on actualy keywords typed in by the user, in this case "presonus 16" or does it also compile data for searchers who opt for the "suggested" term "presonus 16.4.2" ??? To clarify, does anyone have any insight as to whether Google is compiling data on strictly the term typed in from a use or giving precendence to a term being selected by a user that was listed as an auto-suggest, or, are they being counted twice???? Very curious to know everyone's take on this! Thanks!
Intermediate & Advanced SEO | | danatanseo0 -
Which search engines still use Meta Keywords?
I know Google doesn't use meta keywords in meta tags, but i was wondering if there are other smaller search engines that still do? Id it worth it to add meta keywords for them?
Intermediate & Advanced SEO | | jhinchcliffe0 -
Best SEO META Description for forum topics
What would be the best SEO META Description tag for forum topics on a forum type website? I can think of a few options so far Snippet of first post. Title of the topic with templated trailing text Remove description tag completely Your thoughts and suggestions are greatly appreciated.
Intermediate & Advanced SEO | | Peter2640