Title: PHP include .. possible
Last modified: February 4, 2024

---

# PHP include .. possible

 *  Resolved [rosastrich](https://wordpress.org/support/users/rosastrich/)
 * (@rosastrich)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/php-include-possible/)
 * is it possible to include php files into a php snippet?
 * See : [https://www.php.net/manual/de/function.include.php](https://www.php.net/manual/de/function.include.php)
 * if so, where to store the include files?
 * thx Rosa

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

 *  [Yordan Soares](https://wordpress.org/support/users/yordansoares/)
 * (@yordansoares)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/php-include-possible/#post-17403675)
 * Hi [@rosastrich](https://wordpress.org/support/users/rosastrich/),
 * Technically, you should be able to use `include()`, but I think the purpose of
   this plugin is precisely not having to touch code directly on files saved in 
   your server.
 * Maybe if you explain a little more what you want to do, the author, or one of
   the contributors (like me) could give you a more appropriate advice. Do not hesitate
   to explain with a use case as an example: That would be very useful!
 *  Thread Starter [rosastrich](https://wordpress.org/support/users/rosastrich/)
 * (@rosastrich)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/php-include-possible/#post-17412652)
 * well I generally use one cfg file for e.g. login into a DB.
 * so credentials etc. are not part of the php itself, and can be used in several,
   different scripts. That’s all ..
 *  [Yordan Soares](https://wordpress.org/support/users/yordansoares/)
 * (@yordansoares)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/php-include-possible/#post-17412873)
 * Thanks for providing more details. I never tried that, but it should work.
 *  Thread Starter [rosastrich](https://wordpress.org/support/users/rosastrich/)
 * (@rosastrich)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-include-possible/#post-17419361)
 * do you know the folder to store such a file…?
 * thx Rosa
 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-include-possible/#post-17423263)
 * There’s not a specific folder you need to use – what matters is just that you
   get the path right.
 * For example, you could put your `.php` files in `wp-content/`, and then load 
   them with:
 *     ```wp-block-code
       require_once WP_CONTENT_DIR . '/my-file.php';
       ```
   

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

The topic ‘PHP include .. possible’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/php-include-possible/#post-17423263)
 * Status: resolved