locked
how to dynamically update the meta title on page load without creating duplicates? RRS feed

  • Question

  • User1766386569 posted
    Hello everyone! This is where I filter my SEO elements. I am new to asp.net and c# and I would really appreciate a suggestion on how to filter the "town" and append it to the title in the cases where the same town exists in two different counties. Many thanks
    if (town.Length > 0)
    {
    if (town.Equals(county))
    {
    BasePage.Title = dr["PageName"].ToString() + " " + town + " " + "Town" + " " + dr["SEOTitle"].ToString();
    BasePage.Description = dr["PageName"].ToString() + " " + town + " " + "Town" + " " + ":" + " " + dr["SEODescription"].ToString();
    BasePage.KeyWords = dr["PageName"].ToString() + " " + town + " " + "Town" + "," + dr["SEOKeywords"].ToString() + " " + town + " " + county;
    }
    else
    {
    BasePage.Title = dr["PageName"].ToString() + " " + town + " " + dr["SEOTitle"].ToString();
    BasePage.Description = dr["PageName"].ToString() + " " + town + " " + county + " " + ":" + " " + dr["SEODescription"].ToString();
    BasePage.KeyWords = dr["PageName"].ToString() + " " + town + " " + county + "," + dr["SEOKeywords"].ToString() + " " + town + " " + county;
    }
    }
    else
    {
    BasePage.Title = dr["PageName"].ToString() + " " + town + " " + county + " " + dr["SEOTitle"].ToString();
    BasePage.Description = dr["PageName"].ToString() + " " + town + " " + county + " " + ":" + " " + dr["SEODescription"].ToString();
    BasePage.KeyWords = dr["PageName"].ToString() + " " + town + " " + county + "," + dr["SEOKeywords"].ToString() + " " + town + " " + county;
    }
    Wednesday, May 23, 2018 9:10 AM

All replies

  • User-330142929 posted

    Hi AlexZaharia,

    According to your description. I could not understand your requirement. Could you please post more details information or examples about your requirement?

    For example:

    I have some towns and country as below:

    TownA   TownB TownC

    CountryA CountryB  Countryc

    I want:

     

    TownA  = CountryA                                  show the title as “TownA + CountryA

     

    TownB , TownA is exists in CountryA         show the title as “TownA + CountryA

    …..

    If you could post more examples about the actual situation. It is more easily give you a solution.

     

    Best Regards,

    Abraham

    Thursday, May 24, 2018 7:46 AM
  • User1766386569 posted

    Hi Abraham! 

    You see, the County is a tier 2 type of page (by URL) and the town is accessed from the respective county page. The code is for the meta title, description and keywords as you can see but regarding that I have to make sure it doesn't create duplicates. 

    tier 0 : www.mydomain.com

    tier 1 : www.mydomain.com/trade    (  <title>   trade | SEOTitle  </title> 

    tier 2 : www.mydomain.com/trade/county     ( <title> trade county | SEOTitle  </title> )

    tier 3 : www.mydomain.com/trade/county/town   ( <title> trade town county | SEOTitle </title> )

     if(town.Equals(county) then (<title> trade town "town" | SEOTitle </title> )

    in terms of SEO this still creates duplicates as I can have same tier 3 town for 2 different tier 2 county pages. I'm sorry for the ambiguity.

    Friday, May 25, 2018 9:13 AM
  • User283571144 posted

    Hi AlexZaharia,

    In my opinion, I suggest you could generate the title as below to avoid duplicate:

    tier 0 : www.mydomain.com

    tier 1 : www.mydomain.com/trade    (  <title>   trade | SEOTitle  </title> 

    tier 2 : www.mydomain.com/trade/county     ( <title> trade county | CountyPage | SEOTitle  </title> ) // we tell the search engine this is the county

    tier 3 : www.mydomain.com/trade/county/town   ( <title> trade town county | TownPage | SEOTitle </title> )// we tell the search engine this is the town

    If the user search the name in the search engine, the search engine will show all the page with that name no matter, it is a town or county.

    So we just need to tell the user this is a county page or a town page.

    Best Regards,

    Brando

    Tuesday, May 29, 2018 2:45 AM
  • User1766386569 posted

    Hi Brando

    You are a gentleman. thank you for your suggestion. I have tried it before. It causes me the SEO title length issue in that case. 

    Regards,

    Alex

    Tuesday, May 29, 2018 8:25 AM
  • User283571144 posted

    Hi AlexZaharia,

    As  far as I know, the google's default title length is 66 characters.

    It will not exceed the title length

    Could you please tell me how long should the seo title match?

    Best Regards,

    Brando

    Wednesday, May 30, 2018 1:25 PM
  • User1766386569 posted

    Hi there again, Brando.

    You see, the example I put up in my question is just generic and it's theoretical. the actual domain is other one.

    When comes about the trades, the same thing, and so on for county and town. I am using an online tool to check my websites SEO's. (google bot)

    In terms of title length we are talking about 75 characters. the site is very big and the number of pages goes up to over few thousands.

    I am generating them all dynamically anyway. At the minute 1600 have title duplicates. 

    In the end of the day I am to choose between to bad things the least worse of them. I.E title duplicates or length exceeds.

    Unless I come up with a solution in the code behind for the page meta data. 

    Thank you,

    Alex

    Wednesday, May 30, 2018 1:38 PM
  • User283571144 posted

    Hi AlexZaharia,

    In my opinion, you could exceed the characters limit of a meta title and description.

    But you have to keep in touch with your ranking keywords data also and you have to note that you are winning or loosing your ranking on that keywords.

    Google typically displays the first 50-60 characters of a title tag. If you keep your titles under 60 characters, you can expect about 90% of your titles to display properly. There's no exact character limit, because characters can vary in width and Google's display titles max out (currently) at 600 pixels.

    Best Regards,

    Brando

    Thursday, June 7, 2018 2:40 AM