Why do I get strange characters in my url
Here is today’s question from the comments left here. Feel free to add yours.
My questions is how to “fix up†the URLs which my WP installation is giving me that include the (aasci?) junk characters when I’ve just used a dash or a blank or similar in my article title.
For example…
http://garyharvey.net/affiliate-marketing/what%e2%80%99s-best-%e2%80%93-affiliate-marketing-or-product-creation
The article title was:
What’s best – affiliate marketing or product creation?
I’ve set Permalinks to include the category and the post title but how to get rid of the junk letters from the rendered title??
Is there a fix for this oopsey?
Okay here is the problem and unfortunately the answer is no. You need to take care of the way you title your article. Certain characters are not used in urls so you will always get the strange character combinations that you are seeing.
First there can’t be a space in a url. This is why when you set your permalinks to use your title it changes from Mike likes this to Mike-likes-this replacing each space with a dash. If you use a dash with a space to either side it then creates — which is also not valid.
To compensate the permalink uses the code for the – (%e2%80%93) for the center -.
You have the same problem when you use an ‘ in your title. That is not a valid symbol for a URL so it replaces it with the underlying code (%e2%80%99) for that symbol.
Taking care with your title can help you avoid that if it is of concern to you.
Here is where it gets sticky in my opinion. I always want to write for the reader first. I also don’t believe it will hurt you in the search engines havings the code as part of your url because they understand what it is. It doesn’t look good to you but…
The headline is your ad for the article. I don’t believe it will stop many from clicking through as the search engine has highlighted any words that they have searched for so you will have relevancy to their search. If trying to change your title just for this reason weakens the hook to get people to read I think you will be hurt more by that than by having a clean url.
Just my opinion but my readers always have to come first.
If you have questions or comments let me know. If you have a question you would like answered please leave a comment or click the survey above.
Filed under: questions
Like this post? Subscribe to my RSS feed and get loads more!






Leave a Reply