Title: Include/require external php code
Last modified: August 21, 2016

---

# Include/require external php code

 *  Resolved [nirgalo](https://wordpress.org/support/users/nirgalo/)
 * (@nirgalo)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/includerequire-external-php-code/)
 * Hi, I used the “include” and “require” directives inside [insert_php] tags in
   order to include an external PHP file, but the result is that the file gets printed
   out (echoed) on the page. Any idea how I can actually include PHP files? Thx.
 * [http://wordpress.org/plugins/insert-php/](http://wordpress.org/plugins/insert-php/)

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

 *  [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * (@willbontrager)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/includerequire-external-php-code/#post-4227129)
 * Hi nirgalo,
 * It should work.
 * Verify the included and required files are accessible and contain no errors.
 * If still no joy, post the code that doesn’t work, (including the [insert_php]
   and [/insert_php] tags). I’ll see what I can see.
 * Will
 *  Thread Starter [nirgalo](https://wordpress.org/support/users/nirgalo/)
 * (@nirgalo)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/includerequire-external-php-code/#post-4227169)
 * Thanks Will but I actually created a plugin to put my functions into so I do 
   not need to include files anymore.
 *  [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * (@willbontrager)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/includerequire-external-php-code/#post-4227208)
 * Gratuitous post to mark thread resolved.

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

The topic ‘Include/require external php code’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3523853)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

## Tags

 * [require()](https://wordpress.org/support/topic-tag/require/)

 * 3 replies
 * 2 participants
 * Last reply from: [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/includerequire-external-php-code/#post-4227208)
 * Status: resolved