In wordpress this is possible to get a blank line before php <?php tag or after ?> tag. This produce problem for RSS feed this seems very easy to handle things in wordpress as we always see for plugins etc, But its not very easy.
You should know php closing tag ?> is not essential its optional php can close itself when page ends so if you are not ending your php at end of page lik ?> then there are rare chances for php to get a whitespace after closing tag.
Here are different files you can check for blank spaces.
- Check your theme’s header.php , footer.php, functions.php , sidebar.php, index.php.
- Check your wp-config.php if that have any whitespace before or after php tag.
- Check includes/feed-atom.php and includes/feed-rss2.php files for possible blank spaces.
- You can deactivate all plugins and reactivate them. Or try to change plugins forlder name to something else then you can take it back as plugins after test.
- Make sure this is on first line of your header.php
<!DOCTYPEand where header.php are being get like index.php they do not have blank line before adding this <?php include(‘header.php’); ?> tag.
There can be more reasons but 95% this is the reason of blank space after or before php tags. <?php ?> .