SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create a site with a title provided from a user and use the title as the site url. However I want to remove spaces and diacritics.

I replace spaces with a hyphen, and I run RemoveDiacritics as described here.

Is there a suitable method in Sharepoint API (like SPUtility or so) to achieve this goal.

share|improve this question
up vote 1 down vote accepted

Here's an article from Microsoft Support on invalid characters in Sites:;en-us;905231

I'm not aware of anything in the SharePoint API that would handle this for you. You can obviously take what Microsoft puts out there in the above article and write some code and/or some regular expressions to enforce those rules. This is an article I had referenced in the past on file names...and while it's not 100% identical to the rules on site titles it's a good place to start:

share|improve this answer
Unfortunately there seems not to be a suitable method in Sharepoint API for that. But I do it as described here – Anatoly Mironov Aug 22 '11 at 15:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.