#18332 closed defect (bug) (invalid)
Blank lines after ?> in wp-feed.php causes XML feed error
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Feeds | Version: | 3.2.1 |
| Severity: | normal | Keywords: | reporter-feedback close |
| Cc: | claudiobastos@… |
Description
The blank lines after ?> in php files causes XML be misunderstood by feedburner or other feed "clients".
Fix is very easy: just cut the empty lines after the php tags in wp-feed.php and problem will be gone.
It would be interesting search these blank lines on other files as well.
This is the error: Fix wordpress rss feed error "Error on line 2: The processing instruction target matching "[xX][mM][lL]" is not allowed." while yo
This a portuguese blog that explains the error: http://www.dowordpress.com.br/erro-no-processamento-de-xml-feed-wordpress/
Change History (5)
- Keywords reporter-feedback close added
- Severity changed from critical to normal
comment:2
alexbenfica — 22 months ago
Hi!
I did a lot of teste in the last months with the default template and without plugins trying to solve this, but the problem was there.
Just today I could solve it in one of my sites removing those lines.
But... in another one of my sites, I changed the file and problem persists, even without plugins and orignal theme.
I thing that, just in case, all files should not have empty lines in the and... even because different webservers+PHP configurations can have diferent treatments for this detail.
comment:3
SergeyBiryukov — 22 months ago
Can't reproduce it either. wp-feed.php is not even used by core to generate a feed, it's deprecated and all it does is just a 301 redirect to the default feed URL.
comment:4
RyanMurphy — 20 months ago
- Resolution set to invalid
- Status changed from new to closed
Closing this as wp-feed.php was removed in r18540
comment:5
SergeyBiryukov — 20 months ago
- Milestone Awaiting Review deleted

A Single blank line after a closing ?> is striped/ignored by PHP, only multiple new line will be output.
The usual suspect here is Theme (functions.php) and/or Plugin files with multiple linebreaks outside of the PHP. WordPress Core doesn't output extra lines itself, and I just verified that myself.
Can you just check to see if it IS the linebreak from that file, or if its indeed from a plugin/theme?