If you have a WordPress blog and an iPhone/iPad, then you most likely have the WordPress for iOS app. If you don’t, you should.

Over the past couple of days, I have been receiving the following error when trying to add my blog to the iPhone app.

After scouring the internet, I found that this could be the result of a few issues.

  • Special characters in a post body that are not supported by NSXMLParser
  • Special characters in a comment
  • Invalid post or comment RSS
  • An error in a theme/plugin file

For me, this turned out to be an issue with the comments RSS feed. I loaded it up in the browser and long behold, even the browser threw an error. But what could be causing this? Turns out, I had left a space in a plugin that I created. This caused a space to be output at the beginning of the comments XML, causing it to error. Notice the space between ?> and <?php below. (Face Palm)

After removing the space from this plugin, I loaded up WordPress for iPhone and it added my blog without a problem.

So, the take away from this is don’t output spaces when you create a plugin.

I hope this post has proven useful for you, I can’t imagine that I’m the only person with this issue 😉

Tweet