Copy & paste post title can cause special chars in slug
See original GitHub issueWhen a post is created and the title is being copied and pasted from another source, some special chars e.g. control chars or whitespaces, are included in the slug. Ghost can’t handle those and returns a 404 for the requested post.
Those special chars (e. g. 0x08
) need to be stripped out from the title & slug.
Example:
DB: slug: kp-video-unofficial-201 title: 201柯文哲 北市長選舉非官方競選影片
Visible on site: slug: kp-video-unofficial-2018%08 title: 2018�柯文哲台�北市長選舉非官方競選影片
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
custom post types - Slug Formatting : Acceptable Characters?
No, forward slashes are not allowed to be used in slugs. However, they are automatically stripped out when trying to include slashes in...
Read more >Strange Characters added in my URL - WordPress.org
I have to create a new post, copy paste the content from the weird URL post into ... I'm afraid that could be...
Read more >Symbol "<" (Less-than sign) in the title cuts all further text in slug
Symbol "<" in the title, shouldn't cut all further text in slug. This symbol should only be excluded, (replaced with delimiter, etc).
Read more >Create a slug that accepts certain characters for blog url
Please how do I create a slug for my php blog with a function that will accept only alphanumerics,inverted commas,commas,full stop,colon,empty ...
Read more >Permalinks & Slugs – WordPress.com Support
A slug will be different when the title contains certain characters, like spaces or currency symbols, as well as anything else that isn't...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you’re on macOS it’s possible to replicate by using the Character Viewer (https://stackoverflow.com/a/4946245/1163866 - slightly different on recent macOS versions but the principle is the same) to insert the control characters.
@kirrg001 I think the problem with these characters in titles/content might surface when we try serving them in XML (for example as a part of sitemaps). Would need to investigate this specific use-case, but I remember that’s the place I had a problem at.
The original issue is fixed, so I think it could be closed. We’d raise a new one if XML suspicion is confirmed 👍