Title: A way (or plugin) to insert PHP, Javascript, etc into a WordPress post?
Last modified: August 19, 2016

---

# A way (or plugin) to insert PHP, Javascript, etc into a WordPress post?

 *  [ahrenba](https://wordpress.org/support/users/ahrenba/)
 * (@ahrenba)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/a-way-or-plugin-to-insert-php-javascript-etc-into-a-wordpress-post/)
 * Hey Guys,
 * I am sometimes able to insert Javascript into my WordPress posts, but it usually
   just ends up breaking and never works correctly.
 * Is there a way to successfully add javascript or PHP code to a page. I am not
   talking about adding the code and actually showing it on the page, but let’s 
   say I actually wanted the PHP or Javascript to run something (such as an embedded
   YouTube video)
 * How can I do this?

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

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/a-way-or-plugin-to-insert-php-javascript-etc-into-a-wordpress-post/#post-855576)
 * You are asking 3 different questions: how to have PHP, JS and embedded video.
   
   The answers is yes, for all of them, although they all require a different solution.
   1. search for plugins like phpexe, execphp and similar keywords. 2. [Using_Javascript](http://codex.wordpress.org/Using_Javascript)
   3. [http://www.google.com/search?q=site:http://wordpress.org/extend/plugins/%20embed+video](http://www.google.com/search?q=site:http://wordpress.org/extend/plugins/%20embed+video)
 *  [NC@WP](https://wordpress.org/support/users/ncwp/)
 * (@ncwp)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/a-way-or-plugin-to-insert-php-javascript-etc-into-a-wordpress-post/#post-855639)
 * ahrenba,
 * A little while ago, I actually wrote a simple plugin that allows you to include
   free-form PHP / HTML / JavaScript / whatever into WordPress posts/pages. You 
   can download it [here](http://www.myvirtualdisplay.com/2008/09/11/including-free-form-php-into-wordpress/).
 * Note, however, that if you use it to include PHP scripts, they will not be included
   in the PHP sense of the term; rather, the PHP script will run in its separate
   memory space, unrelated to WordPress, and its **output** will be embedded into
   the including post/page. So if you intend to include PHP scripts that rely on
   WordPress’ environment, data, or authentication, you will need to explicitly `
   include()` the proper WordPress files…
 *  [hernanvionnet](https://wordpress.org/support/users/hernanvionnet/)
 * (@hernanvionnet)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/a-way-or-plugin-to-insert-php-javascript-etc-into-a-wordpress-post/#post-855967)
 * Hi dudes.
    I’ve included the folowing php code with **[this plugin](http://bluesome.net/post/2005/08/18/50/)**
   and it has worked OK!
 *     ```
       <p><strong>Projet Categorized as:</strong>
       <small><?php the_category('<br /></br>'); ?></small></p>
       <p><strong>Projet's Tags:</strong>
       <small><?php the_tags(''); ?></small></p>
       ```
   

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

The topic ‘A way (or plugin) to insert PHP, Javascript, etc into a WordPress post?’
is closed to new replies.

## Tags

 * [exec](https://wordpress.org/support/topic-tag/exec/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [post](https://wordpress.org/support/topic-tag/post/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 4 participants
 * Last reply from: [hernanvionnet](https://wordpress.org/support/users/hernanvionnet/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/a-way-or-plugin-to-insert-php-javascript-etc-into-a-wordpress-post/#post-855967)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
