How to find out which WordPress plugin produces faulty output

Today I checked my homepage and found a faulty output in the header of the page.

Faulty output from WP plugin

Viewing the page source I realized that the output was generated before the starting html tag. It looked like a comment from a PHP script:

// ommit closing tag, to prevent unwanted whitespace at the end of the parts generated by the included files */

So my first thought was that it must be a bug in a plugin. But which one? I could have startet to deactivate one plugin after antother and check back the frontend. But there is a better way if you have SSH access to your Linux webserver.

Login to your webserver and change in the root directory of your WordPress installation. Then execute the following command where the last string in quotation marks is your search string.

find . -type f -name "*.php" | xargs grep -l -s "ommit closing tag"

This command searches in the current directory and all subdirectories in every .php file for the string “ommit closing tag”. The result was “email-encoder-bundle/email-encoder-bundle.php”. So I knew directly which plugin caused the faulty output, deactivated it and contacted the author.

Notify of

Inline Feedbacks
View all comments