Tinkering With the Related Posts Plugin

For ages now I’ve had a section in the sidebar of single-post pages that lists some other (possibly) related posts. The problem is with the ‘possibly’ — the suggestions just haven’t been very good.

I’ve been using Related Posts (2.02) by Alexander Malov & Mike Lu. It takes the words from the title of the current post and matches them against the text and title of all your other posts. If I were better at naming my posts it could work much convincingly … but I’m not and never will be.

The plugin has a secondary mode which lets you embed keywords in your posts and uses them instead of the post title but I have 450 posts to retrofit… Moreover, my brief dalliance with tagging tools made me realise how hard it is to produce helpful keywords. I can stare at one of my homilies and have no idea how to tag it. ‘Jesus’, ‘God’, and ‘love’ are too vague and anything sharper seems to prejudge what a homily is about … which I hate. After all the words should speak for themselves.

Now there’s a thought! How about picking the most frequent words in a post and using them to generate our match? You’d have to filter out ‘is’ and ‘and’ all the bland words. How many words would you need for a relevant match? I tinkered with the guts of the Related Posts plugin and here it is in working order on all my single-post pages. I’m really surprised how relevant its suggestions are.

See what you think. If nothing blows up I’ll make the plugin available.