WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been having problems with a custom taxonomy not working with a url. For example mysite.com/testcat/test1 will 404 but mysite.com/make/ford will work.

More troubling is that mysite.com/?make=ford&testcat=test1 will bring up my test page (both taxonomies where included).

Here is a clipping of the functions.php

register_taxonomy( 'testcat', 'videos', array( 'hierarchical' => True, 'label' => 'testcat', 'query_var' => true, 'rewrite' => true ) );

Any ideas of what i'm doing wrong?

share|improve this question
up vote 1 down vote accepted

Did you flush your rewrite rules after you created the taxonomy?

I tested your code (only changing 'videos' to 'post') by adding to my functions PHP (TwentyEleven Theme WordPress 3.2 Trunk) then flushed my rewrite rules and created a post and gave it the testcat of test1 and the URL worked.

add_action( 'init', 'c3m_wp_stackx');
function c3m_wp_stackx() {
register_taxonomy( 'testcat', 'post', array( 'hierarchical' => True, 'label' => 'testcat', 'query_var' => true, 'rewrite' => true ) );

Screenshot: enter image description here

share|improve this answer
I think I flushed my rewrite rules.... I originally went from the custom permalinks to standard then back to custom, but it was still broke. I then added a / to the end of the permalink, then removed it again and all is well. Was that flushing it? I couldn't find an easy way on google. Anyhow it seems to work now, Thanks!! – SkinnyGeek1010 Apr 26 '11 at 4:28
When you visit the permalink settings page your rewrite rules get flushed. They also get flushed when you make a change to your permalink settings and click update. – Chris_O Apr 26 '11 at 5:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.