Title: Search results showing php code
Last modified: August 30, 2016

---

# Search results showing php code

 *  [TheBusinessManager](https://wordpress.org/support/users/thebusinessmanager/)
 * (@thebusinessmanager)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/search-results-showing-php-code/)
 * Hi there. First of all, thank you for creating this plugin. It’s been really 
   useful to me.
    My website is showing the actual PHP code on the search page. 
   I would appreciate if you could take a quick look and bring some light on this
   issue. Here is an example:
 * [http://lottomatic.info/?s=euromillions](http://lottomatic.info/?s=euromillions)
 * Regards,
    — Gabriel
 * [https://wordpress.org/plugins/insert-php/](https://wordpress.org/plugins/insert-php/)

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

 *  Thread Starter [TheBusinessManager](https://wordpress.org/support/users/thebusinessmanager/)
 * (@thebusinessmanager)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/search-results-showing-php-code/#post-6894807)
 * Just wanted to let you know that although the actual php code can’t be seen on
   the search page, the problem is not solved.
 * I’ve been editing the code of my search.php file so that the page doesn’t display
   the php code anymore. Simply couldn’t leave it like that…
 * Just thought I’d let you know…
 *  [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * (@willbontrager)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/search-results-showing-php-code/#post-6894865)
 * Hi Gabriel,
 * Unfortunately, there’s not much I can suggest without seeing the code you’re 
   using. But here are three:
 * – Verify you’re using the “Text” tab and not the “Visual” tab when inserting 
   or editing the PHP code.
 * – Verify your PHP code doesn’t throw an error. Error logs are your friends.
 * – Have a look at the Code Elements That Don’t Work section of the Insert PHP 
   Instruction page.
    [http://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php#nonworkingelements](http://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php#nonworkingelements)
 * Other sections of that page might also throw light on what you’re experiencing.
 * If the code you’re using with Insert PHP is confidential, you may submit it to
   me directly via our secure form
    [https://www.willmaster.com/secure/](https://www.willmaster.com/secure/)
 * Will
 *  Thread Starter [TheBusinessManager](https://wordpress.org/support/users/thebusinessmanager/)
 * (@thebusinessmanager)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/search-results-showing-php-code/#post-6894869)
 * Hi Will. Your prompt reply is much appreciated.
    I am using the Text tab instead
   of the Visual.
 * Basically the php code is most of the time a require_once to a certain file along
   with a variable, such as:
 * [insert_php]
    $my_variable = ‘somevalue’; require_once(‘somedir/somephpfile.php’);[/
   insert_php]
 * Again, it shows fine on every page except the search page where instead of being
   parsed, the actual php code is being displayed as it is in the wp backend editor.
 * As mentioned before, my problem is solved for now and I can live with this solution
   but if you’ll manage so find an “out of the box” solution for this, I’ll be more
   than happy to hear it.
 * Also, I will get back in case I find out something that may be helpful.
 * Happy New Year to you Will!
    — Gabriel
 *  [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * (@willbontrager)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/search-results-showing-php-code/#post-6894870)
 * OK, if the very same code works on other pages of the same WordPress installation,
   then the difference is related to the search page.
 * Perhaps whatever does the searching or provides the results somehow preempts 
   the page or otherwise prevents the Insert PHP code from running.
 * The code you provided should work. With the same code on other pages where it
   works OK, the only reason I can think of that it might not on this page is what
   I mentioned, that somehow the code doesn’t reach the Insert PHP plugin or the
   output of the plugin is discarded.
 * Will

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

 The topic ‘Search results showing 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

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

 * 4 replies
 * 2 participants
 * Last reply from: [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/search-results-showing-php-code/#post-6894870)
 * Status: not resolved