hey like i said in the question i want use the plus sign(+) instead of dashes so the posts will be like that: some+post+test another question , when i use non-latin characters the wordpress break the permalink and preserve just 30 words !! how can i solve that?
Asked
Active
Viewed 299 times
-1
-
The `+` sign is a reserved character in URLs. What exactly is the problem you are trying to solve with this? – Pekka Oct 06 '10 at 12:23
-
hey Pekka , i know that plus sign is a reserved character , but there is million of sites use it ! there is no problem but i have a client who wants that , and what about the second problem , do you any idea dear? – Hamza Oct 06 '10 at 12:25
-
why do you want to do this in the first place? – Pekka Oct 06 '10 at 12:28
-
@pekka because a client wants that's type of url ! i asked him to change it with '=' or underscores but he refuse . – Hamza Oct 06 '10 at 12:34
1 Answers
0
The + sign is a reserved character in URLs and will translate to a space .
From what you are saying, though, your underlying issue is that you want to use non-ASCII characters in URLs. That is not valid in the first place: You will have to percent encode the slug before inserting it. Most modern browsers will show the URL in its proper form anyway.
Here is an on-line tool for percent-encoding incoming data. For example, the UTF-8 input of
Crêpes
will translate to
Cr%C3%AApes
Background info: Unicode characters in URLs
-
hey pikka like im said in the last comment for sure there is a method to use it ; there is many websites use plus sign for Spaces . – Hamza Oct 06 '10 at 12:28
-
@Hamza you can try adding spaces to the WP slug and seeing whether they get converted to `+`. Other than that, I know of no easy way of changing Wordpress so it accepts that character. It's easy to do if you control your own web pages and URLs, but Wordpress is a more complex thing – Pekka Oct 06 '10 at 12:30
-
yes that's true , that's why im posted the question because i have tried but i didn't get a result ; about the non-latin characters , wordpress cut the slug and preserve just 30 lettre !! – Hamza Oct 06 '10 at 12:31
-
@Hamza well, try percent encoding. Although I can imagine that the 30 letter limit is something built into Wordpress. – Pekka Oct 06 '10 at 12:33
-
@Pekka no its something related to octets , because if i entry an english title(with 1000000000000 words) all works fine ! – Hamza Oct 06 '10 at 12:36
-
@Hamza yes, as I said, you can't use non-ASCII characters in URLs. You need to percent encode them. – Pekka Oct 06 '10 at 12:38
-
-
@Hamza read by answer and the background info I link to. It's all there. – Pekka Oct 06 '10 at 12:50
-
i read it but where i have to post the function into wordpress because im not friendly with it! – Hamza Oct 06 '10 at 13:02
-
@Hamza you can percent escape the slug in the on-line tool to link to. If you want to do it automatically in WP: That I don't know. I would ask another question for that – Pekka Oct 06 '10 at 13:06
-
for sure i'll not oblige the client to do that everytime per day! and thanks – Hamza Oct 06 '10 at 13:11