So I am having an issue where I can’t pull variables such as mysite.com/?utm_campaign=testing unless I am logged in as admin or editor.

When logged out and just a regular users I can’t grab any variables which start in utm_ such as utm_campaign. However utmcampaign works, and any other variable I try. Just not utm_ ones.

I disabled all my plugins but still have the same issue. Not sure where the filtering is coming from and not sure why it only filters when not logged in as admin.

I tried accessing the variable using three different methods:
1. Injecting PHP code using the “Code Insert Manager” plugin

 <?php echo $_GET['utm_testing']; ?> 
  1. Using the built-in function of formidablepro to grab the GET variables.

  2. Using the same code as #1 but inside my footer.php file of my template.

All have same results.

3 Answers
3

It’s not a core behaviour to overwrite the global $_GET array, which means it’s likely that something else then WordPress itself is the issue here.

I would suggest the following steps to debug the issue:

  • Disable all active plugins and revert to standard theme, see if the problem persists.
  • If the problem is still there, open the index.php in your document root and write var_dump($_GET); exit(); in the first line to see if the variable is making it through the webserver. If it isn’t showing up now, it means that it is filtered for some reason by the webserver (i.e. bad .htaccess rule, or conflicting mod_security rule).
Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *