Title: Using PHP code in wordpress pages???
Last modified: August 19, 2016

---

# Using PHP code in wordpress pages???

 *  [Nico](https://wordpress.org/support/users/claytrainor/)
 * (@claytrainor)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/using-php-code-in-wordpress-pages/)
 * Hi, What i am trying to do is pull a variable from a url, ie.
 * [http://www.example.com/index.php?Key=hello](http://www.example.com/index.php?Key=hello)
 * I’m able to do this on a normal php page with the following php code
 * `<?php echo str_replace('-', ' ', $_GET['Key'])?>`
 * But i can’t seem to get it to function in wordpress.
 * How would i go about doing this?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/using-php-code-in-wordpress-pages/#post-913996)
 * If you put that code in a [Template](http://codex.wordpress.org/Templates) or
   use a [exec PHP code plugin](http://wordpress.org/extend/plugins/exec-php/) (
   i.e. so you can put code in posts) does it work?
 *  [miktheguy](https://wordpress.org/support/users/miktheguy/)
 * (@miktheguy)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/using-php-code-in-wordpress-pages/#post-914013)
 * execPHP did not work for WP 2.6.3 (at least on my installation) so I use [runphp](http://www.nosq.com/blog/runphp/)
   which works great!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using PHP code in wordpress pages???’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [miktheguy](https://wordpress.org/support/users/miktheguy/)
 * Last activity: [17 years, 4 months ago](https://wordpress.org/support/topic/using-php-code-in-wordpress-pages/#post-914013)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
