Putting Code Together Since 1987

WordPress and the iPhone

In Web Development, Wordpress on December 27, 2007 at 5:00 pm

Two hot topics, in one post. WordPress is the hot blogging tool right now, and the iPhone is one of the hot mobile phones too.

So it’s a shame that they don’t work that well together. In this article I go through the following:

  • Posting to WordPress.com from the iPhone
  • Posting to a self hosted version of WordPress using the Mobile Admin plugin
  • Posting to WordPress from the iPhone and including images with the post

The latter is a particularly vexing problem, and one to which I can’t solve for WordPress.com. However, it’s relatively easy for self-hosting, or profesionally managed WordPress site owners to get images into their website, from their iPhone. Or for that matter, many other platforms. But this post in particular is all about getting on with WordPress when using an iPhone. Mainly because my shockingly generous girlfriend got me one for Xmas, I’m poorly, and I don’t feel like doing any ‘proper’ work today.

So let’s begin…

WordPress.com and the iPhone

WordPress and WordPress.com both use, by default, the TinyMCE editor. And it’s not a bad little editor either. A little buggy at times, but it’s feature rich and simple to use. What it won’t do, at least as supplied by WordPress, is work with the iPhone. You’ll have to tap on the Code tab above the editor and just enter plain text. You can then publish just fine.

If you’re only blogging from your phone you can turn off the visual rich editor in the WordPress Users | Your Profile tab in order to make this a simple one touch job. It may also save you the occassional Safari crashes that I experienced with the MCE editor running, even though I didn’t use it.

But… you probably aren’t limiting yourself to phone only blogging, and you probably like the editor. It lets you do nice things. But there’s also another problem… go down to the Upload part and you’ll notice that you can tap as much as you like on a “Choose File” button, but nothing will happen. So you can’t add images from your iPhone to your WordPress blog.

WordPress, the iPhone, and the Mobile Admin Plugin

If you’re a regular mobile blogger and you have your own, self-hosted or managed WordPress installation, then you have the option of plugins. And one of the handiest for WordPress is the Mobile Admin Plugin. You’ll need to follow the usual plugin steps – checking for compatibility, installation, and activation. But once you’ve followed the instructions it really does make using the iPhone (and for that matter, many other phones) on WordPress sites a cinch.

What’s great is that if you access the site admin using a normal PC, you still get the normal control panel.

Below are a couple of screenshots showing it in action:

WordPress Mobile Admin Screenshot 1

WordPress Mobile Admin Screenshot 2

Lovely isn’t it? And if you’re wondering why I’m not posting any of my own screenshots, it’s because I’ve not hacked my own iPhone in order to get the SSH access I’d need to take screenshots.

There’s only one downside, and I feel it’s a big one, to the whole Mobile Admin experience. It’s important to me as I’m a visual type and I like illustrations wherever possible – especially if I’m travelling and feel like showing some shots of where I’ve been. I’m also particularly keen to make it work as I had photoblogging to my WordPress site (Dave’s Geeky Play Area Blog) working just fine from a Nokia N95. Ok, that took some hacking too, but I’ve had photos… I want to continue with photos!

Posting Images to a WordPress Blog With Your iPhone

If you host your WordPress site yourself, you can do a lot… and get images from your iPhone directly to your site!

Now, the iPhone won’t tolerate MCE yet, and it won’t use the upload wizard in standard WordPress. So what’s to do? ftp tools don’t exist yet, so you can simply ftp your shots onto your site… which suggests that you’re stuck.

Well fear not. I’ve been casting around all afternoon and found the following works best. Basically, with WordPress you can set it up so that you can post to it by e-mail. This does require setting up either a cron job (something many hosting providers won’t do or allow) or it means hacking around so that the job fires off every now and then. Thing is, the standard WordPress wp-mail.php program doesn’t actually work all that well with images. In fact, it doesn’t work at all with anything other than text. So you’ll need something a little more…heavyweight.

But with WordPress there’s always a way. The plugin you need is called Postie, and this is what you have to do:

  1. Install the Postie plugin
  2. Read the instructions! Maybe do that before installing it?
  3. Go to the Postie config page as instructed (it’ll show the readme first – just refresh), and set your image resize to something appropriate to your theme
  4. Set up an e-mail account on your host that’s especially set up for receiving posts to your blog. Keep it a secret and make the password tricky too. Configure this information in Postie, bearing in mind the default port for e-mail is 110 (not defaulted into the form by the Postie plugin).
  5. And then the easiest way to get an image to your site is from the iPhone image gallery press the little swoosh icon in the bottom left of the image viewer.
  6. Tap Email Photo.
  7. In the New Message box you should enter the To: e-mail address that you set up in step 4. You can also enter some text in the box. Press Send.
  8. Now, the content won’t appear yet in your blog, but it’ll be waiting… all you need is to send a browser to http://www.yourdomain.com/wp-content/plugins/postie/get_mail.php or, if your WordPress is installed in its own directory: http://www.yourdomain.com/WordPressDirectory/wp-content/plugins/postie/get_mail.php
  9. You can set up a cron job if you’re allowed, but it’s not my favourite way anyhow. I like to just have a favourite in my browser for mail posting which I click on whenever I need to update the site.

And that’s it! Ok, it took a bit to get there, and it’s not integral to WordPress so you can’t guarantee support on version changes, but… it’s one way forward, I’ve tested it, and it works well on WP 2.3.1. If you spot any mistakes, please comment!

If this post is popular I may well try and add some screenshots, photos and sample posts. I also plan to do a similar post soon on the Nokia N95 and WordPress.

  1. […] What blogging I have been doing has been on the A Liverpool Web Designer blog hosted at WordPress.com – in there you’ll find various technology articles.  Including my proud little post where I worked out how to blog properly on WordPress from an iPhone. […]

  2. You could also just use Mobypicture.com.
    You can just send your photo/video text, title and tags in an email and Mobypicture distributes this directly to your blogs (WordPress, Blogger, Tumblr…

    It even sends it to your Flickr album and notifies your buddies at your microblog Twitter, Jaiku…)

    Check it out at: http://www.mobypicture.com

  3. Funny enough, I was thinking of adding a note about Mobypicture as I found it just a bit after.

    Mobypicture does indeed look good. The only downside I can see is the requirement to hand over your logon and password to a third party. As you’d have to be able to encode and decode these there’s a potential security risk.

    On the upside, it allows you to post images to WordPress.com from your mobile phone, so it does answer that particular problem.

  4. We try to use Oauth (or Oauth like options) for connecting to the accounts.
    For Blogger, Flickr and some other platforms we already use that.

    WordPress doesn’t support this kind of authorisation yet, but soon probably will…

    All I can say is we handle all our user info with great care…

  5. Of course – your reputation depends on it!

    Oauth would be great. Good to see you take these things seriously anyway, and it’s definitely an interesting system you have there.

    I’ll have to do a review at some point.

  6. […] WordPress and the iPhone « A Liverpool Web Designer :: [Tags: wordpress ] […]

  7. […] testing this wp mobile admin interface plug-in and posting from the […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: