# Limit maximum chars possible for page url

**URL:** <https://forum.getkirby.com/t/limit-maximum-chars-possible-for-page-url/6491>\
**Category:** Questions\
**Tags:** v2\
**Created:** [February 1, 2017, 9:56am UTC](https://forum.getkirby.com/t/limit-maximum-chars-possible-for-page-url/6491 "2017-02-01T09:56:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)\
**Post date:** [February 1, 2017, 9:56am UTC](https://forum.getkirby.com/t/limit-maximum-chars-possible-for-page-url/6491/1 "2017-02-01T09:56:52Z")

</div>

i recently encountered a problem, that my client entered a very long title for a page. the resulting slug was equally long. this caused mailjet to not accept the url (longer than 100chars).

i know i can limit the maxLength of the title field but that does not solve nested pages. i would like to know if there is any way to validate the slug. registering a hook seems possible, `strlen($page->url())` and changing the slug if needed. but i would like to make this more visible for the user.

is it possible to display any other message instead of the `:)` after saving? not with just a hook, right?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [February 1, 2017, 10:42am UTC](https://forum.getkirby.com/t/limit-maximum-chars-possible-for-page-url/6491/2 "2017-02-01T10:42:59Z")

</div>

> [@bnomei](#):
>
> mailjet

Maybe use tinyurl or something like that to circumvent the problem?

---

<div class="post-metadata">

**Author:** ![bnomei](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bnomei/32/775_2.png) [@bnomei](https://forum.getkirby.com/u/bnomei)\
**Post date:** [February 1, 2017, 11:15am UTC](https://forum.getkirby.com/t/limit-maximum-chars-possible-for-page-url/6491/3 "2017-02-01T11:15:56Z")

</div>

yes. `tinyurl()` for the mailjet newsletter object is my current solution. but i wanted to keep all base links the same, like not mixing tinyurls and regular urls. since almost all browsers support about 2000 chars i find mailjets limit unreasonable.

i will try to think of another solution and report back.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [February 1, 2017, 11:19am UTC](https://forum.getkirby.com/t/limit-maximum-chars-possible-for-page-url/6491/4 "2017-02-01T11:19:34Z")

</div>

Yes, a 100 character limit is a bit ridiculous. But the problem is, where do you want to start shortening the urls? Probably depends on your nesting structure, if it is not very deep, you can limit yourself to tuning the last path.

But with a hook, you cannot change the message in the panel.

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 4:52pm UTC](https://forum.getkirby.com/t/limit-maximum-chars-possible-for-page-url/6491/5 "2025-02-06T16:52:50Z")

</div>

Archived on February 6, 2025, 4:52pm UTC


