Title: Php code disappears
Last modified: June 28, 2017

---

# Php code disappears

 *  Resolved [dgirona](https://wordpress.org/support/users/dgirona/)
 * (@dgirona)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/php-code-disappears/)
 * In WordPress 4.8, in new layout mode HTML width the code php disasppears.
 * Help please.

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

 *  Plugin Author [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [8 years, 9 months ago](https://wordpress.org/support/topic/php-code-disappears/#post-9275889)
 * Nope, not in this plugin, it doesn’t. The PHP Code widget is not a derivative
   of the built in text widget. It does not include the new 4.8 text widget code,
   it is a separate widget entirely.
 * Edit: If it does, then that would be *very* strange. There should not be any 
   tabs at all in the PHP Code widget. I’ll investigate further.
 *  Thread Starter [dgirona](https://wordpress.org/support/users/dgirona/)
 * (@dgirona)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/php-code-disappears/#post-9276112)
 * Thanks!
 * My solution has been to program a widget : )
 *  Plugin Author [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [8 years, 9 months ago](https://wordpress.org/support/topic/php-code-disappears/#post-9309768)
 * Just to follow up on this, I can confirm that the PHP Code widget does not have
   the new HTML editor that the default text widget does in 4.8.
 * WordPress adds the TinyMCE editor specifically to Text Widgets, not to all textareas
   in general. Since the PHP Code widget has no code to enable the use of the TinyMCE
   editor, it just shows a plain text box, like always.
 * Now, if you don’t have Admin or Editor permissions on the site, then that means
   you don’t have the “unfiltered_html” capability in WordPress. And in such a case,
   yes, your PHP code will be filtered out of the widget. That is not new behavior,
   nor is it caused by any changes to WordPress 4.8. The PHP Code widget has always
   required that you have unfiltered_html in order to use the widget.
 *  Thread Starter [dgirona](https://wordpress.org/support/users/dgirona/)
 * (@dgirona)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/php-code-disappears/#post-9310998)
 * OK thanks.
 * I am web administrator, and before the update the widget worked correctly. Do
   you know how I can solve the “unfiltered_html” problem?
 *  Plugin Author [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [8 years, 9 months ago](https://wordpress.org/support/topic/php-code-disappears/#post-9319148)
 * There is no problem, and there is nothing that changed from the “update”.
 * If you are not an Administrator or Editor of the site, or you otherwise have 
   unfiltered-html disabled in some way, then you cannot put code into the widget,
   same as you cannot put any arbitrary HTML into the text widget.
 * In other words, nothing changed from the 4.8 update. There is literally no difference
   between 4.7 and 4.8 as far as this widget is concerned. If you’re seeing a difference,
   then it was not because of 4.8.
 * So, you need to find out what the actual difference is. If you were able to put
   in code before, and cannot anymore, then somehow, you turned off the unfiltered_html
   setting. Maybe you added some kind of security plugin? Maybe your security plugin
   got an update? Who knows.
 * Basically, do the simple troubleshooting steps. Turn off your other plugins. 
   Switch to a default theme. Find out what is actually causing whatever problem
   you’re seeing, and then you are one step closer to figuring it out.
 * There is *no* change in this plugin’s behavior between 4.7 and 4.8. You’re looking
   in the wrong place, and blaming the wrong cause.

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

The topic ‘Php code disappears’ is closed to new replies.

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

 * 5 replies
 * 2 participants
 * Last reply from: [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/php-code-disappears/#post-9319148)
 * Status: resolved