WordPress problem: Url encoding on Tag’s slug.
When you define or assign tags in WordPress, here is what WordPress does:
1. Every tag must have a name.
2. Every tag must have a slug, the url of the tag.
3. By default, WordPress will automatically generate the tag slug based on the name of the tag you entered.
4. However, if either the value of the tag name or the tag slug is new, then WordPress will consider it is a new tag in the system.
So, a problem will arise, when your blog has non-western language characters or terms been used as tags.
For example, I use Chinese in my tags. In order to keep my url looks nice, every time I add a Chinese tag (or the tag contain non-western & Chinese characters), I need custom to define the tag slug after the new tag was entered in the WordPress database; because, the default slug was generated by WordPress used percentage url encoding. The problem happens when you want to use the same tag again. Because, when you are writing or editing a post in WordPress, either the built-in tag entry interface or the interface provided by some other plugins (e.g. the Simple Tags plugin), you can only choose from the existing tags’ name. The default tag’s entry interface in WordPress 2.5.x is worse on this aspect because it uses Ajax drop-down to suggest a list of existing tag names as you are typing into the tag entry box; but it seems can’t recognized the existing non-western tag names or those tag names have non-western character in it. Anyway, the key point is that, no matter whether you use a plugin or not, if you are assign the existing tag to your post use the tag name, and if the tag name is a non-western language tag, even it is an already existed one, WordPress will not respect the nice slug you have define before, and re-generate a percentage url encoding slug for it. After this been done, since the newly generated slug never exists before, WordPress further to recognized it as a new slug, thus a new tag — but, hey, what you are doing is that you are assign an existing tag to you post!
This problem has cost me much time to correct the tags in the WordPress system. I think bloggers use non-western language should have the same headache as mine. On WordPress 2.3.x, there is a nice plugin called Advanced Tag Entry which developed by the same author of the Language Switcher plugin will allow you choose tags from their slugs, and it has very nice checking to show your which slug is associate with which tag name already in the WordPress database. Saddly, Advanced Tag Entry is not available on WordPress 2.5+. It says that the Advanced Tag Entry functionality has been implemented by the core of the WordPress. But where?
I am wondering, if WordPress will improve the tags mechanism or there is a solution for this problem? If anyone know the answer, please send me a message.
Thank you for reading this post. You can now Read Comments (8)
Post Info
This entry was posted on 11 May 2008 2:37 PM and is filed under Technology tagged with:Multi-language,Url encoding,WordPressYou can follow any responses to this entry through the Comments Feed. You can Leave A Comment , or A Trackback .
Previous Post: Curl better than simplexml_load_file when web screen scrapping »
Next Post: Emergency Aid for Chinese Earthquake: Need 2,6 million Tents right now! »
- The meaning of history
- What is the best system to set up and run a web site?
- I want every Chinese read George Orwell 1984!
- I think we should trying to get to know more each other’s history.
- Google’s customer service, what would Google do?
- Get Start a new eZ Publish project – Part II
- Get Start a new eZ Publish project – Part I
- Google Wave, got in
- The purpose of study Economics
- Music, the “Lifeline”
















5 September 2008 8:55 AM
nice! good sharing…
cheers!
http://www.searchenginerankingfree.com
5 September 2008 11:41 PM
Thanks for read the article. I still wonder how non-western bloggers specify their tags of their post in WordPress.
29 May 2009 6:37 PM
Very interesting read, I think their would be a lot of mixed opinions on this. Love the theme that you are using, what is it?
29 May 2009 9:35 PM
The theme? As the footer text says, “TypoXP Reloaded”.
8 June 2009 1:29 AM
I strongly recommend that you turn the No Follow off in your comment section. I’ll watch Google Webmaster Tools, and if the links don’t show up after a couple of weeks — I won’t go back to that blog again. Another suggestion: you should have a Top Commentator widget installed. Do Follow and Top Commentator will ensure that you have a successful blog with lots of readers!
7 July 2009 1:08 AM
Uq8qKF great tips. I enjoyed reading this,
15 October 2009 2:01 PM
I was searching Google for a solution to convert a Chinese title to a pinyin slug and found this entry. Kind of a weird coincidence considering I already know you through facebook. I think this problem will take too much time to solve so I will just scrap using pinyin slugs and use a unique identifier instead.
12 December 2009 7:33 AM
Cool issue, did not thought it was going to be so interesting when I klicked at the link!!