[wp-hackers] Some Thoughts/Enhancement Ideas In And Around The Category Side Of Things

Mike Schinkel mikeschinkel at newclarity.net
Mon Feb 15 19:52:50 UTC 2010


On Feb 15, 2010, at 2:22 PM, Mike Schinkel wrote:
> When you look at it from the perspective of URL path segments and emergent patterns then the problem suddenly gets much smaller. So I'll make a strawman proposal in my next email.

Here is a "strawman" proposal mentioned in my previous email:

1.) Support pages, category taxonomy terms, and custom taxonomies in the root:  i.e.:

example.com/about/ <-- page
example.com/news/ <-- category term
example.com/countries/ <-- custom taxonomy

Given that these would be in the root then there is a reasonably small finite set of routable slugs.  These could be cached in an array, and if the size of the array exceeded a threshold (i.e. 1000?) then they could be loaded with single SQL query.  Large sites could increase this limit and use custom code with something like memcached.

There probably should be the option to put posts, post types, or other taxonomy types in the root but would be discouraged in the admin with a warning because doing so would almost certainly always force a SQL query to lookup the URL.

2.) Allow any taxonomy term including tags to be optionally included in the root and by selecting that option it would go into the finite set, i.e. 

custom taxonomy terms
example.com/usa/ 
example.com/canada/
example.com/australia/
example.com/uk/

3.) Recommend that tags and posts support a defined structure:  i.e.:

example.com/tags/my-tag 
example.com/2010/02/15/my-post

Having this structure makes lookup into the database much easier and note I only showed one of several potential post options.

4.) Recommend that custom post types support a defined structure:  i.e.:

example.com/products/product1
example.com/events/event1
example.com/courses/course1

5.) Recommend custom taxonomy terms generally use a taxonomy specific structure:

example.com/media/foxnews
example.com/media/cnn
example.com/media/msnbc

5.) Finally support multiple routes for a given post type, taxonomy term, or taxonomy with an optional canonical form to be used.  Consider a "customer" post type, an "order" post type and an "item" post type.

example.com/customers/acme/orders/12345/items/abc123/

My guess is that these patterns would satisfy 99.99% of WordPress developers wanting control of URLs.  Anyone on this thread see how this proposal would not work for their needs?

While this would actually be relatively easy to implement given a clean slate, the current system is so complex I don't have the knowledge nor possibly the skill to create a plugin that could do this and/or be able to write a patch to replace what exists.  This would need to be a project that several knowledgeable people got behind.  I really wish I could do it for WordPress, I just can't.

-Mike


More information about the wp-hackers mailing list