Using WordPress public query variables

Good morning.
I am trying to query various WordPress pages, using public query variables, for example                   //  single post             //  single page

But I don’t understand how to use most of these variables.
And I cannot find complete information about the subject anywhere.

The complete list of public query variables is

var $public_query_vars = array(
      'm', 'p', 'posts', 
      'w', 'cat', 
      'withcomments', 'withoutcomments', 
      's', 'search', 'exact',          
      'sentence', 'calendar', 'page', 
      'tb', 'pb', 
      'author', 'order', 'orderby', 
      'year', 'monthnum', 'day', 
      'hour','minute', 'second', 
      'name', 'category_name', 
      'tag', 'feed', 
      'author_name', 'static', 
      'pagename', 'page_id', 'error', 
      'attachment', 'attachment_id', 
      'subpost', 'subpost_id', 
      'preview', 'robots', 
      'taxonomy', 'term', 'cpage',           

and I managed to figure out intuitively the usage of part of them
such as                   //  single post             //  single page                //  page 4 of 10 in archive               //  10-2013 archive            //  month 10 archive              //  year archive                 //  daily archive (current year and month)                  //  category archive               //  tag archive         //  custom taxonomy archive      //  custom post type archive               //  author archive by id      //  author archive by name                  //  search archive              //  page not found              //  output feed

but the others remain mysterious, such as

'posts', 'w', 'withcomments', 'withoutcomments', 'search', 'exact',          
'sentence', 'calendar', 'page', 'more', 'tb', 'pb', 
'order', 'orderby', 
'hour','minute', 'second', 
'name', 'category_name',       
'attachment', 'attachment_id', 
'subpost', 'subpost_id', 
'preview', 'robots', 
'taxonomy', 'term', 'cpage'

can anybody please shed some light on how to use them?
(Sorry for my English.)

2 s

In simple words – it will tell wordpress what to query (to request a data from database).

in all of cases it will try to search a posts (no mater post this or page or other post type) – eq search uuu on posts (default post type post & pages) and return a results (this is search) – eq to archive for 2013 year (for default post types)

this is a dirty style (non URL/SEO friendly), usually people enable url friendly mode so wp generate a internal rewite rules which transform urls like

into dirty style get variables that can be easily transformed to wp_query (and generated SQL query to get posts) for your template.

Leave a Comment