See the rewrite
and query_var
parameters for register_post_type
and register_taxonomy
in relation to how URLs are formed for custom taxonomies and post types.
http://codex.wordpress.org/Function_Reference/register_post_type
http://codex.wordpress.org/Function_Reference/register_taxonomy
Also take note of the with_front
parameter inside the rewrite arguments for both of the above.
No, I meant based on this:
From Using Permalinks Codex
For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text “page slug” as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties). So, it is best to start your permalink structure with a numeric field, such as the year or post ID.
With all of these rewrite creations with post types and taxes, I wanted to know if these rewrites are going to become an issue for WordPress.
By default a custom post type or taxonomy uses the name as the query var and also uses that as the rewrite base..
ie.
example.com/your-taxonomy/your-term
example.com/your-posttype/your-post
What effect custom taxonomies/post-types have on permalink structures that enable verbose rules i don’t know myself (i use one of the provided structures).
Will there be documentation on this anytime soon? Currently, I can’t put a post-id in front of a post type name in the permalink, but would like to know if the performance issue is degraded.
EP_MASK and rewrite parameters give you lots of control over the structure used for each given post type.
http://codex.wordpress.org/Function_Reference/register_post_type
More on using the EP_MASK (end point mask) can be found here, with some examples to.
http://shibashake.com/wordpress-theme/custom-post-type-permalinks
http://shibashake.com/wordpress-theme/custom-post-type-permalinks-part-2
Otto did a blog about permalink structures here, you may find this of interest.
http://ottopress.com/2010/category-in-permalinks-considered-harmful/
Otto’s blog above should at least help give a better understanding of permalink structures.
In regard to documentation, i’m not sure what you refer to, what in particular isn’t documented that you’d like to see?
NOTE: Documentation is provided by the very users that support and write the software; the community, me, you and everyone else. 🙂
When I posted this, I had Otto’s article in mind.
The documentation only states category and text at the beginning of permalinks are considered harmful. I will add to the codex that this also applies to taxonomies and post-types. I don’t think most people in the community developing these taxonomies and post-types know of the harm they will have with the db rewrites.
Post types have their own rules, like Pages do. They live outside of the permalink structure, as they have their own structure created for them when you register them. My article does not apply to them.
So you are saying there is a way to structure post type and taxonomy urls? Like
mysite.com/music/post-type/post-name
I’ve been going crazy trying to figure this out (Note: I am not a programmer).
Anybody has an updated answer for this – I really want to know if I can create a permalink using taxonomies or custom post and without WordPress creating verbose rules? – After all, we are hard-coding it.
Otto’s answer is the best we have right now. Until you hit up on thousands of CPTs, you’re okay.