• Skip to primary navigation
  • Skip to main content
  • (757)-342-7960
  • [email protected]
  • Facebook
  • Instagram
  • LinkedIn
  • Pinterest
  • Twitter
  • YouTube
Coastal Waters Creative Logo

Coastal Waters Creative

Helping Local Businesses Succeed Online

  • Home
  • About
  • Services
    • Website Design and Development
    • Social Media Management
    • Maintenance
  • Portfolio
  • Blog
  • Domains
  • Contact

Solving the WordPress Remove Blank Line From RSS Feed OR WordPress error on line 2 at column 6 OR XML declaration allowed only at the start of the document

Feb 1, 2012 Tutorial, Wordpress

WordPress has a funny way of making a day challenging.  Especially when you wake up one morning to find all of your RSS feeds suddenly not feeding.  For my blog readers, if this is becoming a familiar rant to you (see Solution #1 and Solution #2), never fear – there is answer if we keep digging and mining for it.

In the past two solutions to our WordPress Remove the Blank Line from the RSS Feed, we added a fix all plugin and we learned how to validate, but the problem refused to remain fixed.  It’s time for a radical new answer. Relax.  This will be simple.

1.  Download the following file:  http://wejn.org/stuff/wejnswpwhitespacefix.php.
Yeah, I was concerned it contained a bunch of viruses, too, but after checking through (and using it on a client’s site), it passes the test.

2.  Upload ejnswpwhitespacefix.php file to your WordPress installation ROOT directory.  You’ll see the wp-config.php file there as well.  You DO NOT want to upload into the theme file or any place else . . .just the ROOT directory of your WordPress.

3.  Edit the index.php file.  You’ll find this in your root directory as well.  Add the following as the second line and right after the <?php
include(“wejnswpwhitespacefix.php”);

While your exact index.php code may vary, you’ll probably have something like this when you’re done:

<?php
include(“wejnswpwhitespacefix.php”);
define(‘WP_USE_THEMES’, true);
require(‘./wp-blog-header.php’);
?>

Don’t forget to save the index.php page.

4.  Reload the RSS Feed and shzammm . . . it’s working again!

 

Reader Interactions

Comments

  1. Patricia Weber says

    June 27, 2012 at 4:06 pm

    This was so helpful for my webmaster and me. Thank you so much. I’ve got this bookmarked now. I’ve had this problem now and then almost every time something else gets updated.

Copyright © 2026 · Coastal Waters Creative · Designed and Hosted by Coastal Waters Creative - Local Business Websites and Digital Marketing