[wp-hackers] slugs and the "-2" post fix

Daniel Bachhuber wordpress at danielbachhuber.com
Wed Dec 5 04:54:05 UTC 2012


Hey Haluk,

This is a (long) known issue. Here are a couple of core tickets to check out:

http://core.trac.wordpress.org/ticket/22226
http://core.trac.wordpress.org/ticket/5809



On Tuesday, December 4, 2012 at 8:51 PM, Haluk Karamete wrote:

> I have two questions that deal with terms' being end up with "-2"
> postfix in their slugs. I run into those when I programmatically
> create the posts/tags/terms.
> 
> My first question has to do with terms' being case sensitive...
> that's one of the two ways resulting a term being end up with a "-2"
> in its slug.
> 
> example:
> 
> If I create a term like "tree" in the "post_tag" taxonomy, it gets a
> slug of "tree".
> if I create another term say "Tree" in the same taxonomy, then the new
> term gets the slug of "tree-2". Even though, I mean the same thing.
> I'm curious to know what's the wisdom behind this default behavior and
> if there is any way to force/tell WP to ignore the case so both terms
> be it TREE or tree get the same slug.
> 
> My second question is on the other situation where two identical
> terms' being end up with the "-2" situation. And this only happens
> when the terms belong to different taxonomies.
> 
> example
> 
> term "apple" created in the "computers" taxonomy gets the slug of "apple".
> and the term "apple" created in the "fruits" taxonomy gets the slug of
> "apple-2". this puzzles the heck out of me. I can understand the first
> situation that I mentioned above to some degree, but this one, totally
> silences me.
> 
> why can't both terms have "apple" as their slug?
> 
> WP would still work with both URLs anyway.
> domain.com/computers/apple (http://domain.com/computers/apple)
> domain.com/fruits/apple (http://domain.com/fruits/apple)
> 
> the current behavior results me to end up with
> domain.com/fruits/apple-2 (http://domain.com/fruits/apple-2) which does not look professional at all.
> 
> Any insight is greatly appreciated. Thank you
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com (mailto:wp-hackers at lists.automattic.com)
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 
> 




More information about the wp-hackers mailing list