1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Comma (,) in SEO Title

Comma (,) in SEO Title

4 posts, 0 answered
  1. thelyrist
    thelyrist avatar
    16 posts
    Registered:
    18 May 2007
    24 Jul 2011
    Link to this post
    I am running Sitefintiy 4.1 SP3

    Sitefinity was complaining that my SEO Title contains invalid characters.  The offending character? A comma!

    So Instead of putting something like "Company Name - Service A, Service B, Service C in Vancouver, BC, Canada" or whatever, which is pretty standard, I had to use a dash!

    The 'Title for search engines' contains invalid symbols.

    Many other characters such as single quote work, so I am not sure why "Comma" is being singled out here!

    Please kindly advise!

    Update: Found a workaround in the Bug forum.  Please delete.  Still, I think comma should be permitted by default.





  2. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    25 Jul 2011
    Link to this post
    Hi Thelyrist,

    You can fin-tune the regular expressions for special characters in Pages in 4.1. Please take a look at this forum thread which contains a discussion on the topic.

     Please find a screenshot attached to this reply showing the location of the regular expression setting for SEO Title for Create pages (if you want to apply this setting to Edit pages, you have to do the same changes in the FrontendPagesEdit section.

    Regards,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Stacey
    Stacey avatar
    291 posts
    Registered:
    18 Oct 2012
    24 Aug 2011
    Link to this post
    I wanted to post how I went about allowing a special character in an effort to make things maybe a little bit easier for people who do not know how to use regular expressions.  There have been references all over the place in separate threads, but this one seems to get referenced a lot.  Regular expressions are not my thing, but I did spend a bit of time trying to learn what the default string [^\p{L}\s\-\!\$\(\)\=\@\d_\']+ is doing.  I will try to elaborate for anyone who is curious, but I may be wrong on some of this so will appreciate being corrected if that is the case.

    Ultimately I have seen two solutions to allowing special characters into the SeoTitle (Browser Title).  One suggestion has been to alter the expression and another has been to just remove it completely.  Removing it does work, but at the risk of allowing people to put whatever they want into the title without any type of validation.  In either scenario you need to make sure that you do not just alter the SeoTitle, but also the validation section that goes with it.  I will link screenshots that show where these are.  You need to be sure to make these changes for both FrontendPagesCreate and FrontendPagesEdit.

    I wanted to allow a pipe character | into my title's.  if you only want to do that then you can just look at the screenshots and see what I did.  It seems to work for me.  Basically just add the | to the end of the expression within the brackets. i.e. [^\p{L}\s\-\!\$\(\)\=\@\d_\'|]+

    These expressions are what are called character classes and basically they are searching a string for all characters that are not listed within this expression.  If any matches are found then it throws the invalid error message.

    Character classes are expressed with the brackets [ ].  The + at the end of this expression allows the character class to repeat so that it can match all invalid characters and not just the first one it finds.   Setting a caret within this bracket ^ tells it to match against everything that is not within the bracket, which is also called a negated character class.  Some of these characters have to be escaped with the backslash.

    So here is what is going on.  We are searching for everything that does not belong to these matches.

    \p{L}   is allowing for a single unicode code point that belongs to a "letter" category.

    \s  is allowing for all whitespace and non-whitespace characters

    \-  is allowing a hypen

    \! is allowing an exclamation

    \$ is allowing a $

    \( is allowing the opening parenthesis

    \) is allowing the closing parenthesis

    \= is allowing the =

    \@ is allowing the @

    \d is allowing all numeric digets 0-9

    _  is allowing the underscore and does not need to be escaped with the backslash

    \'  is allowing the single tick '

    |  is allowing the pipe character and does not need to be escaped.
  4. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    29 Aug 2011
    Link to this post
    Hello Stacey,

    Thank you for sharing the information with the community. This will be indeed helpful to those who experience problems with the filtering expressions or those who want to customize their Title fields.

    All the best,
    Victor Velev
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

4 posts, 0 answered