Controlling WordPress autoformatting
October 30, 2009 - Geekiness
The last post contained lots of StreetView frames, and it took me a while to work out how to get them to appear properly. WordPress automatically adds <BR /> tags to the line endings, which is kind-of ok for text, but really messes things up if it chooses to do it in the middle of a block of embedded HTML.
There’s a plugin which fixes this – it’s called PS disable auto formatting. It doesn’t work quite how you’d expect though. What it does is disable auto-formatting completely, therefore changing the appearance of all your past posts, and means that for all future posts you’ll have to add the line feeds manually if you do your editing in HTML mode. The latter isn’t too much of a problem for me, but the former? Well it’s not exactly what I was hoping would happen.
Fortunately there’s a way around this. The plugin adds an option at the bottom of your settings panel (bottom left in the WordPress admin screen) for Autoformatting. If you look in this option, you’ll see that you can do “Batch formatting on past posts”. This will insert the required line endings in posts before a certain date. Set the date just after the date of the last autoformatted post, press go, and your back catalogue will be nicely autoformatted. It advises you to backup your database before using it (which is good advice, but I never heed good advice, and it worked OK for me).
Many thanks to Kieran for pointing me in the direction of this plugin.