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

This is an odd problem that I have never run into before with WordPress.

I have a site, permalinks enabled.

The url can be http://mysite.com/page-name/?anyParamName=testing

then when I use print_r($_GET); or echo $_GET["anyParamName"] I get an empty array or nothing respectively.

A pure PHP file works fine so its not a server issue. Does WordPress do anything with rewiring the get params? Really puzzled by this.

share|improve this question
Where are you putting print_r( $_GET ) etc? In a theme file? – Boone Gorges Mar 19 '12 at 19:01
I've tried it all over the page.php template file, even before the header. – wesbos Mar 19 '12 at 19:03

For custom parameters you should register them with WordPress:

function wpse46108_register_param() { 
    global $wp; 

Then the value of 'anyParamName' can be found with get_query_var

$anyParamNameValue = get_query_var('anyParamName').
share|improve this answer

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.