Categories
Personal Reflections Technology

Switching to Akismet Spam Protection

Switching over to Akismet spam protection on my blog. Lemme explain. CAPTCHA – those small image boxes with weird random characters are a very nice idea, but a little low on accessibility. This is one thing Blogger had – accessibility for the visually impaired using audio CAPTCHA; but that doesn’t seem to be that nice an idea on WordPress. So I thought of using this another one, called Math Comment Spam Protection. It basically gives a simple math addition question, for people to solve and show they aren’t a bot. Very effective idea. Except that there seemed to be some problem with my blog. You see, all the admin folk and authors of this blog, when signed in, could post comments without a problem – so we never detected it. I came to know this later, thanks to Uma and Naman, that when others tried to enter any comments it would show them the 404 error page.

My bad, that I didn’t test it for such a situation. Anyway, I’ve now switched to WordPress’ own Akismet system – which uses statistical analysis to determine whether a comment is spam or not, without the need for the user to solve any challenges. I was initially against using this, because on every goddamn WordPress blog with Akismet activated that I blog on, it MY comments as spam. It probably won’t block me on my blog when I’m the admin myself; but I didn’t want it to happen to anyone else either. The problem is that Akismet doesn’t tell the user the comment has been blocked as spam if it is, it simply refreshes the page.

Do tell me if there are problems with this. Of course, WordPress 2.5 has come out, but I’ll probably be upgrading after the AIEEE – because I don’t want to spend time now trying to sort out any plugin conflicts.

Categories
Personal Reflections Technology

Converting Tags To Categories In WordPress

Update
Spent the last two days working furiously, integrating more plugins, checking whether they work, throwing exceptions, adding Google AdSense ads, et al. Which reminds me, I wanted to add Yahoo! Publisher Network ads – apparently, they pay more, allow you to receive payments via PayPal, and even let you add ads to PDF files and RSS feeds – BUT, and this a big pain in the butt, they want US-based publishers only with predominantly US-based traffic (otherwise, they even ban people…brr).

The Error
One problem I encountered immediately after shifting was using the ‘Convert Categories to Tags’ feature in WordPress. Hadn’t used it on WordPress.com hosted blogs earlier, so I was shocked to see that it DID copy all categories into tags – but at the same time, it deleted those categories too. Hell, those posts didn’t even come under the default category, they simply went off the radar. Since it was a time when I was doing multiple changes to my blog per day, I hadn’t bothered to take a minute-by-minute database backup. I had nothing to fall back to. No problem, I thought, other people must have faced the same problem, and there must be SOME script / plugins out there to handle the conversion of tags back into categories. Surprisingly, there weren’t any.

The Solution
Spent the rest of the day trying to figure out the WordPress database, and a few trials (and a some backup restores later), I hit upon a way to do it.

  1. If there are any existing categories which are named exactly the same as any tags, delete them from Manage > Categories on your WordPress dashboard. The only reason I say this is because it’ll save you a lot of headache while editing the database.
  2. First thing, whenever you do ANY sort of mucking about with databases – back it up! On hosts like GoDaddy, you’ll have an option in your hosting manager to create an SQL dump; otherwise, open up your database manager (on the server) and choose the Export option.
  3. Login to your database manager – which would be phpMyAdmin generally. You’ll need to use the username and password you created initially for this. Generally, the username could be the same as your database name. In case it isn’t, you should’ve written it down, dum dum. :p
  4. Open the database related to WordPress and open the table wp_terms_taxonomy. Check phpMyAdmin’s documentation if you don’t know how. Explaining that is not my job.
  5. Check the box next to any fields which are marked as post_tags, leaving the category and link_category fields as it is. Then, click on the Edit icon at the bottom of the table.
  6. Replace post_tags with the text category in the Edit page. No other change is necessary. Submit the form.
  7. If you run into a MySQL error, of the sort – ‘xx-category already exists’, where ‘xx’ is a number – that has happened because a category and a tag have the same name, and therefore that particular post_tag can’t be renamed to its equivalent category field.

That’s that! Login back to your WordPress dashboard, and you’ll find that all categories have been restored using the tags which were created. Personally, on WordPress, I feel that the categories feature is better than tagging – at least presents a list to choose from! Tagging, on the other hand, doesn’t have auto-complete (by default, at least) on WordPress.

And frankly, WordPress’ categories to tags converter sucks – first, erasing categories, and then not even warning the user before doing so.