Title: How to allow PHP code in posts?
Last modified: August 18, 2016

---

# How to allow PHP code in posts?

 *  [paticoflange](https://wordpress.org/support/users/paticoflange/)
 * (@paticoflange)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/how-to-allow-php-code-in-posts/)
 * Greetings WP community. I’m using WP more as a CMS than as a blog — am very happy
   with the layout and people who contribute to this program. My site will consist
   of entries that will allow people to read about and download videos that I make.
   Linking to these videos, as well as showing images from them, is easy. I want
   to have the option for people to rate the videos too, as well as have a PHP script
   displaying the number of downloads per video.
    I’ve found (more or less) scripts
   that do what I want, but the WP parser (?) won’t let me post functional PHP code
   in an entry. Any ideas on how to bypass this? A plug-in? I don’t know PHP, and
   while recommendations that I ought to learn it are appreciated, I’m thinking 
   more along the lines of tapping those brains which have already achieved this
   feat. Thanks!

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

 *  [TechGnome](https://wordpress.org/support/users/techgnome/)
 * (@techgnome)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/how-to-allow-php-code-in-posts/#post-70066)
 * mmmm, yeah, this is going to fall into the category of “it doesn’t work like 
   that.” And there is a reason why. PHP is a server side script and needs to be
   executed. By putting the PHP into a post, it (the website/server) isn’t going
   to know to execute the code within it. It’s not a WP thing, it’s just the way
   PHP works.
    TG
 *  [stevarino](https://wordpress.org/support/users/stevarino/)
 * (@stevarino)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/how-to-allow-php-code-in-posts/#post-70067)
 * Although [my method](http://stevarino.com/2004/03/wordpress-hack-php-entries/)
   is horribly outdated, there are several improvements which some have kindly offered
   availible in the entry’s comments and pingbacks. 🙂
    _I really should get around
   to updating these…_
 *  Thread Starter [paticoflange](https://wordpress.org/support/users/paticoflange/)
 * (@paticoflange)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/how-to-allow-php-code-in-posts/#post-70087)
 * OK, I can handle that PHP doesn’t work like that. Can you call a PHP script in
   an entry though? I think that’s what I’m really talking about anyway, not actually
   executing the whole script.
    Example: a download count script. The script resides
   elsewhere, I just need to call to it in my post so that the number will display.
   Is this doable — and how?
 *  Thread Starter [paticoflange](https://wordpress.org/support/users/paticoflange/)
 * (@paticoflange)
 * [21 years, 11 months ago](https://wordpress.org/support/topic/how-to-allow-php-code-in-posts/#post-70088)
 * By the way — thanks both of you. Stevarino, I followed your link and from your
   site found mark.scottishclimbs.com’s 1.2 plug-in. We’ll see how it turns out.
   I had no plans to learn PHP, but I keep getting pulled in deeper…

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

The topic ‘How to allow PHP code in posts?’ is closed to new replies.

 * 4 replies
 * 3 participants
 * Last reply from: [paticoflange](https://wordpress.org/support/users/paticoflange/)
 * Last activity: [21 years, 11 months ago](https://wordpress.org/support/topic/how-to-allow-php-code-in-posts/#post-70088)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
