Why would a GET variable one one page of a site cause a 404 error when a GET variable works on another page of a site?

For example I have 20 pages on a site. one of them is called bacon another called eggs. on the same site…lets say breakfast.com

I have the permalinks set up properly and have used them successfully on all pages, including Eggs by way of this:
www.breakfast.com/eggs?cooked=scrambled.
This works 100% as it should.

Read More

However, on a different page of Breakfast.com called sausage…this, does not work.
www.breakfast.com/sausage?type=spicy

this is causes a 404 error. I don’t see why it would as it’s the same format. I have verified that the page exists in my pages directory in WP-admin.

If I strip away the GET variable the page works. Google is not helping me. Anyone have a similar experience?

Related posts

Leave a Reply

2 comments

  1. WordPress has a list of reserved terms that you cannot use for taxonomies. From your question, I gather that “cooked” is a taxonomy that applies to eggs and “type” is a taxonomy that applies to sausage. Unfortunately, “type” is a reserved term in WordPress, so it interprets your query string differently than you expect.

    The full list of reserved terms is available in the Codex. Just use a different term … maybe “sausage-type” … for your taxonomy and you should be in the clear.

  2. I was seeing inconsistent behavior with query parameters until I registered the parameter with WordPress, like this:

    function add_query_vars_filter( $vars ) {
            $vars[] = "cooked";
            return $vars;
        }
        add_filter( 'query_vars', 'add_query_vars_filter' );
    

    See more here: get_query_var in Codex