Programmatically adding metatags to Masterpages in Web Forms and MVC - seo

Has anyone got any ideas on where we should be adding our SEO metadata in a Web Forms project? Why I ask is that currently I have two main Masterpages, one is the home page and the other one is every other page, they both have the same metadata that’s just a generic description and set of key words about my site. The problem with that is search engines are only picking up my home page and my own search engine displays the same title and description for all results.
The other problem is the site is predominantly dynamic so if you type in a search for beach which is a major categories on the site you get 10000 results that all go to different information but all look like a link to the same page to the user.
edit
It's live here www.themorningtonpeninsula.com

Don't know why this post was moved here either, I put it up on stackoverflow.com. I didn't know about this site but I'm glad I do now!
It is in its essence a programming question and the answer is to use dynamic meta tags to your pages and your the master pages. If you do a search on this most of what comes up is "How to add meta tags to your masterpages" that's easy but not a good idea!
Put this in the page_load of you page then populate the hard coded bits from the database.
Page.Header.Title = "Some new dynamically created page Title!";
Page.Header.Description = "Some dynamically created description";
Page.Header.Keywords = "stuff, more stuff, even more stuff";
HtmlMeta myMetaTag = new HtmlMeta();
myMetaTag.Name = "robots";
myMetaTag.Content = "noindex";
Page.Header.Controls.Add(myMetaTag);
Does the trick.
Cheers,
Mike.

Not sure why this got migrated here since it's really a programming question. To answer the SEO aspect: yes, all pages should have unique titles that describe the page, and usually a relevant meta description.
Note, search engines are picking up all your pages, as a search for site:www.themorningtonpeninsula.com will show you. But since they all have the same title they are probably not appearing in normal searches.
For the technical side, you can definitely set the page title when using master pages in ASP. I think you can set the title when you create a new page, but if not the first line of each page should have the title attribute like in this code from one of my projects. Here the title would be "Help pages":
<%# Page Language="VB" MasterPageFile="~/MasterPage.master" CodeFile="Help.aspx.vb" Inherits="Help" title="Help pages" %>
I'm not 100% sure about the meta description but it should be possible to set that in the VB/C# code behind the page. If you can't get it working I'd recommend asking a more specific programming question on Stack Overflow.

Related

Same url with two title in google search result

"Mogral ಅಥವಾ മൊഗ്രാല്‍" was my website's (http://mogral.in) old title.
Since the title contains the words from another language, I felt it will badly affect the position in the search result.
So I changed to new title; contains only english words.
See this query; it shows old title:
https://www.google.com/search?q=Mogral+ಅಥವಾ+മൊഗ്രാല്‍
See this query it shows new title:
https://www.google.com/search?q=mogral+football+mappilapattu
Why it shows same url with two title?
One more problem is that google add the old titles to pages with malayalam-language titles
See https://www.google.com/search?q=site:mogral.in
I submitted the sitemap for all mogral.in/news/* only after changing the old title.
Why it is happening? how to solve it?
First question would be how long ago did you make the change? It takes time for any changes to be reflected in SERPs. Also, I don't see your site when I use your query examples - I see this post. So, the changes may be getting updated now.
Finally,a sites title and meta tags are suggestions for google, not the rule. Google tries to improve CTR (click through rate) so many times for particular search terms, a modified version of your title and meta description will be displayed in the search results.

SEO - META Tags and Google

I just found out that Google recently decided to start using their own "title" when they display their search results. Also, after checking Yahoo and Bing I saw that the way they are displaying their results are the same but in completely different way than Google.
I guess my question would be, if there is an actual "correct" way of adding titles to my pages in order for Google to display what I want them to and this way get the same results with Yahoo/Bing that are currently using the page's title as a search result (sometimes they pick up the first tag and use it as title).
Any recommendations or links to follow for more studying would be appreciated.
There's nothing you can really do about it. Google will choose what title to display based on criteria they have not made public. This usually is the page's title as found in the <title> tag but if Google feels a different title better summarizes the page's content they may choose to display something else.
You can try to change your page titles to better reflect the page's content and see if that helps.
Using optimal keyword prominency in meta tags according to guidelines... and Google will pick up your meta tags. See our news portal's source and metas (keywords: hírek, választás 2014, etc.): http://valasztas2014.hir24.hu/

Sitefinity 5.X: Override how page title is generated

http://www.sitefinity.com/devnet/forums/sitefinity/developing-with-sitefinity/override-how-page-title-is-generated.aspx#2050837
I would like to override how the page titles for all pages on a site are generated. The client wants the title to be similar to the site breadcrumb where it is a concatenated list of ancestral page names plus the current page.
I figure that this could be generated when a page is saved but I would have to alter the page title of the current page and all child pages. If I did it this way then if they changed their mind later then I would have to regenerate all of the page names.
Alternatively if I could just override how the page titles are put on the page then I could go get the ancestors and generate the title when the page is viewed by a user.
I lean toward the second but I don't know how to do either. Any ideas?
I am working on 5.X.
just cross posting the answer you got on the forums in case anyone is looking here.
The answer from Liam was to refer to this KB article: http://www.sitefinity.com/devnet/kb/sitefinity-4-x/globally-overwriting-properties-for-frontend-pages.aspx
which allows you to use global.asax to override the properties globally. pretty slick, I wasn't aware of it!
My suggestion was if you need to do it at the template level to use the SiteMapBase.GetActualCurrentNode() method to do it manually.
hope you got it all worked out!

Sitefinity 4.4 - Dynamically change page title and description at runtime

Does anyone know how to dynamically change the page title in Sitefinity from a regular user control?
Our scenario is simple. We have a real estate website with a search feature. On the search results page we have a control showing the search results, but we need to be able to change the Page title, description and keywords based on the search performed.
We posted on Telerik, but they gave vague answers and pointed us to incorrect objects or objects that didn't actually work.
?
Regards,
Jacques
The way I've usually done this in the past is by using an external widget template.
By mapping your widget template to an external file, you can use a full User Control (.ascx file) which means you can also run code behind.
From there it's just a matter of running something like
Page.Title = "whatever";
For more info on using an external template for Sitefinity Widgets, check out this post: http://www.sitefinity.com/blogs/joshmorales/posts/11-05-10/mapping_external_templates_for_sitefinity_4_widgets.aspx
Hope this is helpful!

Question regarding how a public SharePoint site is made

I had a look at http://www.westernaustralia.com/au/Pages/Welcome_to_Western_Australia.aspx and I know it's a SharePoint site and I am wondering how it could have been made.
I am mostly interrested in the center column (What's On). Is it an announcement list with thumbnails and Find out more links are pointing to wiki pages? Could it be a custom web part or is it possible to do this sort of thing with SharePoint 2010 out of the box?
Thanks in advance.
You can do this easily with a "What's New" web part. Customize your library view setting and set your webpart to use that view. Add a simple content editor at the bottom of this web part and add those other links like View All etc...
Remember that you can create your own list and make sure to index it so that it can rollback into the What's New webpart.
Looking at the emitted HTML it looks like a custom user control in the page layout to me (hell I could be wrong)
That said though it is possible to do this OOTB and I could build that functionality using the Content Query Web Part and some custom XSL