Title: how do you create a global variable?
Last modified: August 20, 2016

---

# how do you create a global variable?

 *  Resolved [mamikel](https://wordpress.org/support/users/mamikel/)
 * (@mamikel)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/how-do-you-create-a-global-variable/)
 * Hi,
    I’m pretty new to wordpress, but hopefully this is a straightforward one.
 * I want to take the entire query string passed to my plugin, and store it for 
   use later (sitewide).
 * Can anyone point me in the right direction. I’ve tried using define(‘myvariablename’,’
   some value’);
    but I’m probably not understanding things as this is not working.
 * many thanks
 * Matt

The topic ‘how do you create a global variable?’ is closed to new replies.

## Tags

 * [define](https://wordpress.org/support/topic-tag/define/)
 * [global variable](https://wordpress.org/support/topic-tag/global-variable/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [mamikel](https://wordpress.org/support/users/mamikel/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/how-do-you-create-a-global-variable/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
