Kebab Case vs Camel Case in URls
Last modified by Vincent Massol on 2026/08/13 09:36
Context
Currently, XWiki doesn't seem to have any defined rules regarding the URL structure.
On xwiki.org CamelCase is generally used:
- https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/PageEditing/
- https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/DistributionWizard
On Extensions spaces are generally used:
- https://extensions.xwiki.org/xwiki/bin/view/Extension/Action%20API
- https://extensions.xwiki.org/xwiki/bin/view/Extension/Extension+Manager+Application
Comparisons
| Kebab Case | Spaces | Snake Case | Camel Case | |
|---|---|---|---|---|
| Recommended | Using hyphens is widely recommended as best practice because it improves the SEO. Search engines treat hyphens as word separators, making it easier to index individual keywords. It is recommended by several websites (Google, Stackoverflow) and preferred over Snake case. | Not recommended as a delimiter of words, since the URL doesn't look nice when sharing (it's replaced with %20). While URLs with spaces may appear correctly in some web browsers, relying on this is inconsistent, and makes URLs harder to read and less pleasant to share. | Underscores are considered part of a word, so search engines treat connected words as a single term, while hyphens separate words (so that a search engine can index the individual words). | Not recommended because it doesn’t help search engines index each word separately; the words remain concatenated. |
| Pros |
| Human-readable in plain text before encoding which can make the URL easier to interpret at first glance, and in some websites that don't convert the space into %20, it can remain visually clean when displayed. | - |
|
| Cons | Longer URLs when multiple words are used | Automatically encoded to `%20` in URLs; looks messy in links. It would be too risky to rely only on the fact that some browsers don’t convert it into `%20`. | It affects the SEO since words aren't split. |
|
Other best practices:
- Use lowercase letters.
- Eliminate stop words ('a', 'the', 'when', 'while', 'in').
Conclusions
If everyone agrees, we'll need to implement a name strategy for kebab-case and apply it on xwiki.org. This means that when inserting a page like [[Developer Guide]], the URL will be automatically transformed into "../developer-guide".
How Kebab Case would look like for us in doc:
- "../like-application/admin/administer-like-preferences/"
Sources
- Snake Case.
- Kebab Case.
- Camel Case.
- Google recommends using hyphens.
- Stack overflow.
- Experience League Adobe.
- Metamug.
- Design Power.
PS: all the links listed above as sources use hyphen as delimiter.