Terence Eden. He has a beard and is smiling.

Terence Eden’s Blog

Theme Switcher:

Automatically deleting WordPress comments using a theme

· 350 words


The Logo for WordPress.

Let's say you want to automatically delete specific sorts of comments from your WordPress blog. For example, immediately trashing any comment that has a specific phrase "Elephant Juice" in it. You can do this by going to Settings -> Discussion → Disallowed Comment Keys. Or you can add something to your theme's functions.php file. Here's the code snippet: add_action( 'comment_post', '…

Should the WordPress scheduler use datetime-local?

· 9 comments · 600 words


The Logo for WordPress.

There's a brilliant post by WordPress about how they've optimised some of the backend code to make it more efficient. So here's a suggestion for something else which can be optimised. If you want to schedule a blog post to be published later, you have to use this WordPress control: I find it mildly annoying. I don't get why part of it is a dropdown. And the number fields don't pop up my…

Importing IntenseDebate Comment XML into Commentics

· 1,050 words


The Logo for WordPress.

This is ridiculously niche. If this is of help to anyone other than to me... please shout! The IntenseDebate comment system is slowly dying. It hasn't received any updates from Automattic for years. Recently it stopped being able to let users submit new comments. So I've switched to Commentics which is a self-hosted PHP / MySQL comment system. It's lightweight, pretty good at respecting users'…

Build your own "On This Day" page for WordPress

· 1 comment · 350 words


A graphic of a calendar showing the date "February 25 Sunday"

I blog. A lot. Too much really. One of the things I like to do is see what I was rambling on about this time last year. And the year before that. And so on. So, here's my On This Day page and here's how I built it. WARNING Extremely quick and dirty code ahead! This allows you to add a shortcode like [ edent_on_this_day ] to a page and have it auto generate a list of posts you published on this …

Style your WordPress Atom feed

· 8 comments · 500 words · Viewed ~492 times


A nicely formatted RSS feed.

I recently read Darek Kay's excellent post about styling RSS feeds and wanted to do something similar. So, here's my simple guide to styling your WordPress blog's RSS / Atom theme. The end result is that if someone clicks on a link to your feed, they see something nicely formatted, like this: Prerequisites This involves editing your WordPress blog's theme. If you don't know what you're…

Review: AntiSpam Bee WordPress Plugin

· 3 comments · 200 words


Comment with Japanese text. The email address is for an emergency locksmith, the link goes to a sex-doll emporium.

Someone recently complained that using JetPack's Akismet anti-spam plugin wasn't very privacy friendly. So, because I take every minor complaint as a personal rebuke, I decided to switch to AntiSpam Bee - an open source and local antispam solution. And... it's pretty good! There is the occasional false negative - but not significantly worse than JetPack. Most of the false negatives are from…

Help Wanted! Testing Better Markdown Footnotes

· 4 comments · 1,000 words · Viewed ~342 times


A very long footnote.

I've been thinking a lot about footnotes in Markdown. I've contributed a patch to make them slightly better in WordPress. Now I'm wondering how to make them more useful by enhancing their pop-up title text. To that end, I'm writing a patch for PHP Markdown which will display the first ~200 characters of a footnote in the pop-up title text. Hover over the superscript number and you'll get a…

Adding restaurant review metadata to WordPress

· 4 comments · 350 words


Screenshot of a user interface which allows the entry of data.

I've started adding Restaurant Reviews to this blog - with delicious semantic metadata. Previously I'd been posting all my reviews to HappyCow. It's a great site for finding veggie-friendly food around the worlds, but I wanted to experiment more with the IndieWeb idea of POSSE. So now I can Post on my Own Site and Syndicate Elsewhere. The Schema.org representation of a Restaurant is pretty…

The ethics of syndicating comments using WebMentions

· 23 comments · 700 words · Viewed ~555 times


The WebMention logo is a stylised letter W with an arrow at the end.

This blog uses WebMention technology. If you write an article on your website and mention one of my blog posts, I get a notification. That notification can then be published as a comment. It usually looks something like this: This means readers of my post can see where it has been mentioned around the web. They can read your article after reading mine. Nice! I've also set up a "bridge"…

Better sharing of WordPress posts to Mastodon

· 3 comments · 300 words · Viewed ~784 times


The Mastodon logo. It sort of looks like a smiling elephant.

WordPress's Jetpack plugin allows you to easily syndicate your blog to Twitter, LinkedIn, Tumblr, Email, and a few other services. But there's no native way to publish directly to your Mastodon feed. This is a guide to how I got my blog to publish every new post to Mastodon with a nicely formatted preview. This uses Jan's "Share on Mastodon" plugin which you'll need to install and configure. …

Woohoo! WordPress accepted my accessibility PR

· 1 comment · 150 words


Screenshot of a box to enter alt text. It is two lines high and is resizeable.

About 2.5 years ago I proposed a small accessibility improvement to WordPress. It has taken a bit longer than I'd hoped but, as of WordPress 6.1 it has been merged! Now, if you're using the Classic editor, you'll get a larger and resizeable box for entering alt text. Because the text entry uses <textarea> most browsers will also show any spelling errors. Good spelling is essential for people …

HOWTO: Remove the Blubrry PowerPress "New!" Banner

· 350 words


WordPress menu. There is a distracting badge with a white background and red text.

The best thing about WordPress is the plugin infrastructure. A million little gadgets to make your blog better. Sadly, there are all sorts of ways plugin authors can abuse their privileges. Dodgy code and user-hostile features sometimes make plugins more trouble than they're worth. Recently, the normally excellent Blubrry PowerPress plugin pissed me off. It's a useful plugin for publishing…