You will have noticed that some special characters seem to be able to slip into a URL (commas are often the culprit) while others don’t. There are a number of characters other than the standard numbers and letters you are used to that can work in URLs.
Which Characters Are Allowed in URLs?
Not all special characters will cause an issue in your URLs. There are many safe characters. Other non-safe characters risk poor readability, breaking some browsers and causing issues for crawlers.
0 1 2 3 4 5 6 7 8 9
a b c d e f g h I j k l m n o p q r s t u v w x y z
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
$ – _ . + ! * ‘ ( ) ,
And reserved characters like ? (used to denote a query)
Should I Use Special Characters in URLs?
It is common for websites to use alphanumeric character and only one special character, the hyphen, to separate words.
It is unlikely that anyone would expect to see or type a special character other than the hyphen into a URL. For that reason, as well as it looking messy and the risk of accidentally including unsafe characters, I’d always stick to alphanumerics and the hyphen.
Which Characters Aren’t Allowed in URLs?
Any character not in the ‘Safe character’ list above is unsafe and cannot be used in a URL.
Unsafe characters are unsafe for different reasons. Many have common uses in different systems so might result in an undesired outcome which may break the URL.
Why don’t some characters work?
Unsafe characters can lead to unexpected behaviour.
For example, the space character shouldn’t be used because the spaces might disappear or change when the URLs are transcribed or used in different word-processing systems.
If necessary, these unsafe characters can be encoded into the URLs.
Overall, I would recommend sticking with alphanumerics only.
Should I Include Short Words Like ‘and’ and ‘the’?
There is no need to use short words like this, known as stop words.
Stop words are words which are filtered out by search engines like Google and Bing when processing of natural language data. They are often the words which don’t contain importance of significance.
For example, if the title of your page is:
The best guide to making lemonade you will ever find
You’d avoid a URL that exactly matches the title, like this:
Instead, you should go for something shorter and easier to read which is just as good for users and search engines:
Of course, you can add stop words if you want to make URLs slightly more attractive. However, the inclusion of unnecessary words is also going to increase the length of your URLs which is something best avoided where possible.