Title: PHP code shown in the browser
Last modified: August 21, 2016

---

# PHP code shown in the browser

 *  Resolved [jonand_se](https://wordpress.org/support/users/jonand_se/)
 * (@jonand_se)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-code-shown-in-the-browser/)
 * I am a newbie to WordPress development, and PHP, so my problem is maybe a dummy
   error. Anyway, I have created a child theme to the Twenty Eleven theme as suggested
   as the smart way for customization of a theme and the customization I want to
   do is to hide the website field in comments.
 * So I added this code (full file shown) to functions.php in the child theme folder
 *     ```
       <?php
   
       add_filter('comment_form_default_fields', 'url_filtered');
       function url_filtered($fields)
       {
         if(isset($fields['url']))
          unset($fields['url']);
         return $fields;
       }
   
       ?>
       ```
   
 * And it works. The website field is hidden. But the PHP code is shown as one long
   unindented line of text in the top of pages that contains the comments form. 
   Are there any simple explanation to this?

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

 *  Moderator [cubecolour](https://wordpress.org/support/users/numeeja/)
 * (@numeeja)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-code-shown-in-the-browser/#post-4411575)
 * Please provide a link to your site.
 *  Thread Starter [jonand_se](https://wordpress.org/support/users/jonand_se/)
 * (@jonand_se)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-code-shown-in-the-browser/#post-4411583)
 * This is embarrassing but I can’t reproduce it now. When I wrote the post above
   could I with both Firefox and IE on two different computers, as I didn’t trust
   my browser cache (but I emptied it also). Could there be any lag after changes
   are done? Anyway I can’t reproduce this right now but it works just fine! I should
   of course have provided a link already before and the problem showed on for example
   this page before [http://blog.java.jonand.se/sample-page/](http://blog.java.jonand.se/sample-page/)(
   which I will rename to /about soon)
 *  Moderator [cubecolour](https://wordpress.org/support/users/numeeja/)
 * (@numeeja)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-code-shown-in-the-browser/#post-4411590)
 * Your site appears to be using a cache plugin. This would explain the lag.
 *  Thread Starter [jonand_se](https://wordpress.org/support/users/jonand_se/)
 * (@jonand_se)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/php-code-shown-in-the-browser/#post-4411593)
 * Oups! Yes it does! The WP Super Cache. But I said that I am new to WP development.
   This seems to be the apparent explanation. I have seen other strange behavior
   that also can be explained of this. Now I will try to remember to clear that 
   cache every time I want to see the result immediately after an update.
 * Thanks! This was very helpful!

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

The topic ‘PHP code shown in the browser’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [jonand_se](https://wordpress.org/support/users/jonand_se/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/php-code-shown-in-the-browser/#post-4411593)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
