I've got a weird problem that's very similar to this one: Why does Wordpress Pagination Remove the Spaces from my GET Variable?. Except that mine isn't withn search results pages--it's with custom taxonomy pages.

Here's the problem: clean WP install with no plugins. I add a custom taxonomy like so in my functions file:

        'hierarchical' => true,
        'label' => 'My Categories',
        'query_var' => true,
        'rewrite' => array( 'slug' => 'my-categories' ),

I've created a term in this taxonomy called "test one". If I go to the taxonomy page and add a custom var to the query string, everything seems fine (like so: /my-categories/test-one/?something=one+two).

Here's where it gets weird: if I add in some pagination vars (manually changing the URL to /my-categories/test-one/page/2/?something=one+two), the resulting page actually rewrites my URL, stripping out spaces from the custom var (the resulting URL is /my-categories/test-one/page/2/?something=onetwo).

Adding my custom var to the vars list using the query_vars filter has no effect.

There is obviously a bad rewrite happening somewhere in the WordPress core (I assume in the register_taxonomy() function?), but I don't know enough about WP's rewriting API to figure out what it is. Anybody have any ideas?

I'll file an issue in Trac if it is indeed a bug, but I need to know how to patch it short-term.

  • Did you ever find a solution to this issue?
    – sgb
    Mar 2, 2012 at 18:26
  • It was a bug that needed a patch. My ticket has been marked as closed in Trac, and it looks like the patch made it into 3.3, so an update should fix it for you? core.trac.wordpress.org/ticket/18086
    – MathSmath
    Mar 5, 2012 at 15:20

1 Answer 1


I'm answering this just so it doesn't stay in the unanswered list.

This was a core bug that has been patched in 3.3.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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