akismet_recheck_queue returning a blank page / not found?

Posted: July 17th, 2011 | Author: | Filed under: Wordpress | Tags: , , , , , | No Comments »

If your blog has large number of comments in the moderation queue, akismet “check for spam” option that tries to filter out spam from your moderation queue could execute for too long, die, and return either a blank page or a ‘page not found’ error.

However, Akismet does manage to check some comments every time you run it, so if you’ll keep refreshing it you’ll see the number of comments in the moderation queue drop slowly.

As I have over 50K of comments in the moderation queue and no time to keep hitting refresh, I wrote a small hacky javascript code that does that automatically by refreshing an iframe. Just paste the following code in the address bar while you’re on any page (make sure you change YOUR-WORDPRESS_URL) and let it run for some time (make sure the page you wrote that in stays open):

javascript:(function(f,b){b.appendChild(f); f.style.display='none'; setInterval(function() { f.src='http://YOUR-WORDPRESS-URL/wp-admin/admin.php?action=akismet_recheck_queue&'+Math.random(); }, 15000);})(document.createElement('iframe'), document.body)

Or simply click here, input your base WordPress URL and let it run overnight (make sure to keep this post open until it finishes).


Quick random WordPress post hack

Posted: December 26th, 2009 | Author: | Filed under: Wordpress | Tags: | No Comments »

A friend of mine, Dima, was looking for a plugin that’ll make it possible to link to random post for his new site, shlat.im.

He told me over IRC that he couldn’t find any simple plugin to do it, and I replied with this quick hack:

get_var('SELECT ID FROM '.$wpdb->posts.' WHERE post_type=\'post\' AND post_status=\'publish\' ORDER BY RAND() LIMIT 1'));

Just stick it in a rand.php file in the wordpress folder, and link to it. it doesn’t get any simpler than that.