When it came to migrate my blog from an older installation of WordPress to the latest version on WordPress.com, I had a problem. The content export was 20Mb, but the limit was 15Mb. The cause was obvious – SPAM comments had filled up the old one (even though marked as SPAM, they are still exported), and until recently there has been no way other than modifying the database to get rid of them entirely. I had hoped to do that from the new system, but I couldn’t get past square one.
To resolve this, I put together this XSLT to remove SPAM comments from your WordPress exports:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:wp="http://wordpress.org/export/1.0/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns="http://www.w3.org/1999/xhtml">
<xsl:template match="//wp:comment[wp:comment_approved = 'spam']">
<xsl:value-of select="." disable-output-escaping="yes" />
<xsl:copy-of select="@*" />
Unfortunately, I had to manually go and fix some malformed comment HTML (or in the case of SPAM, just delete it) for it to work, since the XML wouldn’t even parse, but once that was done the result worked perfectly for the import. Then it was just a matter of cleaning up old blog links and some HTML that didn’t look quite right in the new template by searching within WordPress.
I hope someone else finds this useful!
It’s been a busy time of late, and my blog has been much neglected, so it is time to get back into it. I’ve started by re-invigorating it and since I have become used to WordPress, I’ve moved it to WordPress.com. Everything should redirect over there soon, and if you are subscribed to the feedburner URL you will already be reading this there and nothing need to change.
Catch me over at https://brettporter.wordpress.com/ !
Posted in Uncategorized
If you are reading this, there is a good chance that you may have been following Planet Apache previously – the aggregator for the individual blogs of committers at the Apache Software Foundation. Recently, the infrastructure team have also set up an official blogs site to set up blogs for official news from the foundation, infrastructure, and for individual projects to use as desired.
This is a deliberately separate feed, so that you can subscribe to foundation news without getting it mixed in with committer’s personal opinions, photography and basically whatever they feel like posting. So if you were previously subscribed to the committers feed at Planet Apache, you’ll need to subscribe to the official blogs separately.
It will be interesting to see how many projects take this up, but already with the infrastructure and foundation blogs there it is worth subscribing to.
Since DevZuz was acquired by Exist , I’ve now move my blog to it’s new home. Hopefully everything redirects here now, and I’ll shortly set up Feedburner properly (finally) so that can be used to subscribe in future. I’m really liking WordPress – though Pebble treated me well, you just can’t go past the wealth of plugins that WordPress offers.
You’ll find some other DevZuz bloggers here too – as well a growing number of others from Exist.
It’s been a crazy busy start to the new year, so things have been a little quiet on this blog. I’ve spent most of my time in January in the Philippines, settling in to the new environment and having a blast with my friends and coworkers from Exist.
I’ll post some more separately on what’s been happening and what’s coming up!