push_type
push_type copied to clipboard
Shouldn't the slug be updated when editing the title?
I've just ran into an issue where a user was making changes to a ton of pages but didn't think about changing the slug as well so we had a lot of mismatches between the titles of pages and the URLs.
Could we make it so that the slug is always updated, not just when creating a new page? Or make it configurable if you want to keep the old behavior?
I think the current behaviour is justified for a couple of reasons:
- Changing the permalink will break any inbound links and create 404s. In your case the user was surprised that the permalink didn't update automatically, but the opposite could occur and a user change the title of a page an inadvertently break inbound links. I think the latter scenario is a more damaging user experience.
- In some cases the user might customise the permalink for SEO reasons or simply to create prettier looking links. Therefore if/when a title is changed it might be frustrating if their customised permalink gets automatically updated.
Based on this I don't think the slug should always be automatically updated, it should be a user initiated event. However, I could see the value in some kind of UI element that gives the user a visual prompt that the title has changed and the slug may need to also be changed. Perhaps there could be a button that reveals itself for one click automatic updating.
Yeah, I can get that. I think that your suggestion of a UI element prompting the user to maybe change the slug would be very helpful!
There is one thing also with the slug. If I manually edit the slug the input will allow me to enter any character I want. It should ideally do the same like if you are entering a title, filtering out unwanted characters, change a space to a - and etc.