Diagnose in 30 seconds
Visit yoursite.com/feed/ in Chrome. View source (Ctrl+U). If anything (whitespace, HTML, PHP notice) appears before `<?xml version="1.0"`, the feed is invalid.
Fix #1, Clean functions.php
Open wp-content/themes/<yourtheme>/functions.php. Ensure the file starts with `<?php` on line 1 with no whitespace or BOM before it. If the file ends with `?>`, delete the closing tag and any trailing whitespace, PHP handles unclosed files fine, and trailing whitespace is the #1 cause of feed corruption.
Fix #2, Check every plugin file
Deactivate all plugins. Test the feed, if it now validates, reactivate one at a time until it breaks. The offending plugin has the same issue as above (whitespace after `?>`).
Fix #3, Remove BOM from files
Byte-order marks (invisible bytes some editors add to UTF-8 files) break RSS. Open functions.php and any custom plugin files in an editor that supports 'Save without BOM' (VS Code: bottom-right encoding → Save with encoding → UTF-8).
When to call for help
If Feedly or your podcast host suddenly errors on your feed, downtime costs subscribers. Our fixed-fee feed repair is $79 and includes validator report + Yoast/AIOSEO reconfiguration.
Common questions
Why is my WordPress RSS feed broken?+
99% of the time: extra whitespace or PHP output before the `<?xml` declaration in the feed. The most common source is a blank line after `?>` in functions.php or a plugin file. View the raw feed source in Chrome to find what's leaking.
How do I validate a WordPress RSS feed?+
Paste your feed URL into validator.w3.org/feed. It shows the exact line where the XML breaks. Combine with 'View Source' on yoursite.com/feed/ to trace the leaked output back to a plugin or theme file.
Does Yoast SEO cause RSS feed errors?+
Yoast itself is clean but conflicts with themes that add HTML output before the feed. If you use Yoast's custom feed template settings, temporarily disable them (SEO → Search Appearance → RSS) to isolate the cause.
Should I close PHP files with ?>+
No. The PHP recommendation for files that contain only PHP is to omit the closing `?>` entirely, this eliminates the risk of trailing whitespace corrupting output. WordPress core itself follows this convention.
