“Spam, spam, spam, bots and spam”

After getting a ton of uncaught spam on our work’s WordPress site overnight, I did a quick Twitter search to see if the anti-spam filtering by Akismet had been down generally.

Instead, I found that Twitter spambots are now trying to sound more genuine by posting comments about anti-spam measures. Trouble is, they’re all posting the same comment…

How to add XML elements to your WordPress RSS feed

A while back, I shared a little way of customising the individual title of each item in your WordPress feed. That was based on filtering the existing title, and prepending the requisite content, which in that example was the post type (Gallery, Video, etc.).

I’m now using a variant of that same technique in The Stage’s new RSS feeds. News, Features, and Columns and their respective subcategories are all implemented using WordPress’s built-in categories system. The relevant category (News, Arts 2.0, Obituaries, etc.) precedes the relevant article’s headline. It’s not an ideal solution: if you grab a category feed, e.g., the RSS feed for Shenton’s View, every article will still contain the category name, even though it’s implicit from the context in which you’re requesting the feed.

Recently I’ve had an additional need, though: to add additional XML elements to an RSS feed in a way that gives additional flexibility to custom clients, but doesn’t break any feed readers.

Continue reading “How to add XML elements to your WordPress RSS feed”

WordPress Wednesday: PostRank

Editor’s Rating

[Note: I’m doing a lot of work with WordPress at work at the moment, so am accumulating plugins, coding tips, tutorials, etc., like nobody’s business. Something I started (and then quickly stoppped) doing a while ago was a ‘WordPress Wednesday’, writing at least one post a week that talked about an element of WordPress and its associated plugins. I’m going to try and keep it going for a little while longer this time…]

There are a bevy of “popular posts”-type plugins for WordPress around. They will look at various metrics – page views, number of comments, etc., – and use an algorithm to work out which posts to include in a widget or other form of display. Some use information collected within WordPress, others connect to third party statistical information, such as Google Analytics, and others do some combination of the two.

One I’m trying out is PostRank, which was developed by a company that has now been bought by Google. In the words of the plugin authors:

PostRank measures the audience engagement with each story by analyzing the types and frequency of online social media interactions – comments, tweets, diggs, etc. The more interesting or relevant the story is, the more active your readers will be in organizing, responding to, and sharing it.

The collection of popular stories the widget generates (see the sidebar) looks pretty spot on to me. It avoids the mistake that others have made of counting hits from Google Images (a search for quite a common word results in many hits for one post that’s several years old now), instead concentrating on actual user engagement.

As well as the widget, the plugin adds an PostRank column to the list of posts in the WordPress admin area so I can see the engagement of my most recent posts at a glance.

All the information is useful, although the design out of the box is a little garish for me, especially when sitting on a template based on WordPress’s default Twenty Eleven theme. The widget has eight selectable colour schemes to choose from, plus a ninth ‘style-free’ option ready for you to apply your own CSS. If I keep the plugin around, I’ll move to that option, but it will take a little time to work out the relevant selectors.

For more information about PostRank, visit the website. And if you’re using the built-in plugin search facilities within your WordPress site’s admin section, be warned – there’s an unrelated plugin also called PostRank out there. Click on the ‘plugin details’ link before installing to make sure you’re looking at the correct one.

WordPress Wednesday: PostRank3Scott Matthewman2011-09-22 17:47:38[Note: I’m doing a lot of work with WordPress at work at the moment, so am accumulating plugins, coding tips, tutorials, etc., like nobody’s business….

Social: WordPress’s new commenting plugin

Just a quick note to say that I’ve added a new commenting & social media plugin, Social, to my blog.

It combines standard WordPress comments with mentions of a specific post on Twitter and Facebook. Other plugins can do the same thing, but Social also broadcasts notifications of new posts to the same social media site, and tracks replies & retweets of that original broadcast message.

It would be nice if the broadcast facility used my bit.ly Pro settings, so that it used my shortening domain, mtthw.mn – something that my previous auto-tweeting plugin was able to do. However, that plugin insisted on garbling apostrophes, quotation marks and other common punctuation, so if Social can cope with this I’m gaining as well as losing.

But this is a very new plugin which has backing from a commercial organisation, MailChimp, so there’s every possibility it will improve in future.

ArtsyEditor: another approach to distraction-free writing

Chrome is distracting. I’m not talking about Google’s browser, but the stuff that’s put around your application’s main working area.

A lot of web-based blog and other CMS editors (including apps I’ve written and/or managed) include huge amounts of chrome – from navigation menus, to fields for additional metadata. A lot of the time it doesn’t particularly matter, but if you’re writing large chunks of prose, an uncluttered user interface is essential.

WordPress can be one of the worst offenders when it comes to chrome. Its standard blog post entry screen is built up of many boxes, each with specific purposes. Users can reduce the impact by switching off boxes they don’t need in the Screen Options dropdown, and then drag and drop the remainder into some sensible order. But it still can mean that quite a small portion of the browser window is devoted to the main task of writing content.

In the recent update to version 3.2, WordPress introduced a full screen mode, which allows all the chrome to fade away, allowing for a predominantly blank screen. Basic WYSIWYG controls are accessible at the top of the page, but everything except your text fades away if your hands remain on the keyboard instead of moving the mouse (see illustrations on this post about the WordPress.com installation – the same illustrations apply to self-hosted WordPress.org blogs). Most of the toolbar functions can be activated with familiar shortcuts – ⌘-B for bold (HTML <strong>), ⌘-I for italic (<em>), etc., so for the most part you can just focus on the writing, applying formatting as needed as you go.

A new WordPress plugin, ArtsyEditor, tackles the same issue in a slightly different, more customisable way.

Continue reading “ArtsyEditor: another approach to distraction-free writing”

How to label non-standard post formats in your WordPress 3 RSS feed

In an attempt to try out post formats in WordPress 3, I flagged my last short post as an ‘aside’. It turns out that, in WordPress’s default “Twenty Eleven” template at least, there’s not too much difference between a ‘standard’ post and an ‘aside’ once you get to the individual page, although they are rendered differently on the site’s home page.

That’s a shortcoming in Twenty Eleven, to my mind. I’m in the process of constructing a WP 3.2-compatible template for work, and while we won’t be supporting all of WordPress’s post formats, we’ll need to format entry detail pages, and flag up entries on index pages, depending on which format we use.

For RSS feeds, Tweets, etc., I may want to indicate the type of post format so that readers know what to expect. For example, if an entry has been defined as a Gallery style post format, I may want the RSS reader to display:

Gallery: A selection of pictures

Modifying WordPress’s RSS feeds are slightly trickier than the web pages, as they’re not defined within the theme folder. However, WordPress’s add_filter can come in very useful, as illustrated in this sample code:

Adding this function to my theme’s functions.php means that last week’s aside now shows up in my RSS feed as:

Aside: Park Avenue Cat, Arts Theatre

As far as I’m concerned, this is a temporary fix. It doesn’t do the same for automatically sent tweets going via the plugin I use for that purpose, and there are other places in a template where you’d want to use a similar technique. But it’s a start, and if you’re out there scratching your head and wondering how to tweak your RSS output, hopefully this may give you some clues.

How I built the Greatest Stage Actor website

Today, we at The Stage launched a new microsite to support our 11-week print series, The Greatest Stage Actor.

We have asked a range of industry experts to propose actors – from any era, any country, male or female – who they think deserve the accolade of being named the greatest theatrical performer of all time. Their nominations have resulted in a shortlist of ten being drawn up, and we are opening votes to the general public.

From now until the beginning of December, we’ll be profiling each of the ten shortlisted actors in the paper each week, and adding more content to the website throughout.

At its heart, the entire site is driven by WordPress 3.0 and the page design is based upon the enormously extensible Hybrid theme framework.

With Hybrid, as with the (non-free) Thesis theme that I use on this blog, the theme makes extensive use of WordPress ‘hooks’ – a series of callback points that get referenced at particular points on the template page. Most WordPress templates use a few callbacks defined in the WordPress core, but then create brand new templates for the home page, for pages hosting individual posts, for archive pages, and so on. In contrast, Hybrid provides a huge array of template pages, each of which is highly structured to allow CSS to address nearly everything really easily. In addition, the number of the callback hooks that the framework adds is huge, meaning that it’s possible to supplement the framework with additional code without having to rewrite whole template pages.

Using Hybrid saved so much time, although better documentation (always a bugbear with open source software where the developers have to double up as the technical writers) would have cut down development time even more.

The site also uses a jQuery plugin called jCarousel to create the rotating banners across the top of each page. After trying a few different carousel options, this one seemed to provide the greatest versatility with the least amount of additional markup.

The only non-Wordpress native elements involve the voting mechanism, which was built by The Stage’s former web developer James Squires (and, after James moved jobs a couple of weeks ago, completed by Aaron Brown). This allows votes to be validated by email address or using a Facebook account, using code built in-house (we’ve expanded WordPress’s built-in commenting features to Facebook accounts using Simple Facebook Connect).

The final technical bit is the web font we are using for our body text on browsers that support custom fonts. We’re using Old Standard TT via Google’s Font API, which gives us a typeface look that’s more similar to the typeface we use in print than the ‘websafe’ Georgia.

In its first few hours since it launched, discussions on Twitter and the like have concentrated on who’s not in the list (and, of those who are, the emphasis on 20th and 21st century actors from the British Isles). Over the course of the whole campaign, I hope that discussion will widen out into what makes a great actor stand out from a good one.

Visit the site now at www.thestage.co.uk/greatestactor.

My top 5 WordPress plugins

Earlier today, Tim Ireland (@bloggerheads) asked over Twitter:

Hello, hive-mind. What are your top 5 must-have WordPress plugins?

I’ve tried out several plugins since moving this blog to WordPress, so coming up with possible suggestions wasn’t difficult. Keeping it to five was, as was deciding on an order for them. I’m not sure the order I eventually went with was the correct one, though, so here are my top 5 plugins, presented in alphabetical order.

NB: Not all the plugins mentioned below are, at time of writing, attested by their authors to work with WordPress 3.0, the most recent version. As with any software, use is at your own risk: all I can say is that they work with my WordPress install.

Custom Post Limits

I first blogged about this plugin almost exactly a year ago, but it deserves another outing. The plugin allows you to fine tune any page where WordPress would normally show multiple blog posts, be it the main index page, monthly archives, lists of posts tagged with a certain phrase, etc.

With the default WordPress installation, all such pages must show the same number of posts, which isn’t always helpful. I’m no longer using the template that initially made me start using this plugin, but it remains in use because it offers setting that should, quite frankly, be a standard WordPress feature.

Google XML Sitemaps

One of the best ways of ensuring that search engines including (but not limited to) Google can find all of your pages, and not just the ones linked from your home page, is the use of an XML Sitemap. This is a file that effectively lists all the unique URLs that exist on your blog, and can also give hints as to which ones you consider the most important, and which ones the search engine spider can poll for changes less frequently.

While most modern WordPress themes are designed well enough to include some best practice methods of search engine optimization (SEO), having an automatically-updated sitemap can really help ensure your posts get the best chance of being indexed accurately.


As its name implies, the Redirection plugin can help you implement page redirects. This can be especially useful if you’ve previously run your blog with different software that used different URL building schemes, for example.

If anybody follows a link from a third party website to an out-of-date URL on your blog, normally they would see an error page (in the parlance of the HTTP specification used by web browsers, the status code of the error is number 404). This plugin allows you to intercept that error before it’s shown to the user, and instead ask their browser to redirect to the new, more appropriate location.

As a result, your readers are happier, search engines (which include the number of successful links coming into your site as part of their ranking algorithms) are happier. It’s a win-win.

The user interface of this plugin isn’t the greatest, to be honest, but once it’s set up correctly you will rarely need to access it too often. It’s worth keeping an eye on the logs it creates to check that you haven’t missed any pages, though.

Theme Test Drive

Everybody wants a little bit of individuality for their blog. Finding the right visual theme can sometimes be the most daunting part of setting up a WordPress blog. While WordPress 3 makes it easy to switch between radically different themes, the last thing you want to do is to have your audience on the web watch you try out theme after theme until you find the one that fits.

Theme Test Drive allows you to apply your new theme so that only you can see it. Regular visitors to your set will continue to see the old theme until you’re ready to switch.

It’s the WordPress equivalent of having a fitting room to try on new clothes, rather than having to strip down and parade about in your undies in front of the other shoppers. Which is just as unpleasant for them as it is for you. (Don’t ask me how I know.)

Yet Another Related Posts Plugin (YARPP)

Back in August 2009, I recommended a plugin that allowed you to automatically build a list of related blog posts. This one’s better. The algorithm takes more of the blog’s content into account, it allows for extra customisation and caching if you need it, and can include the related links in your blog’s RSS feed if you want it to.

If you’re logged in as an administrator and view your blog posts while this plugin is switched on, each of the recommended links also displays a relevance score. In theory, this can help you identify if you need to use a cut-off value to eliminate links to posts which aren’t quite as relevant as you’d like. In practice, I’ve found that YARPP is reliable enough not to need any tweaking at all.

WordPress Wednesday: Efficient Related Posts

* Update: I now recommend [YARPP](http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/) for related posts instead. Read why in my post [My top 5 WordPress plugins](http://matthewman.net/2010/07/29/my-top-5-wordpress-plugins/)

WordPress is a great blogging platform. And because it’s built on PHP, it’s possible to include lots of dynamic code that gets evaluated and run whenever one of your website’s readers loads a page.

Too many such dynamic elements, though, and it can seriously degrade your site’s performance, especially if those elements require complex database access. A case in point is any plugin that calculates related posts ‘on the fly’. The more posts your blog has, the longer any such calculation would take. And given that every reader will be shown the same related posts information, recalculating that information on every page view doesn’t make much sense.

A caching plugin (for example, WP-SuperCache) would help, but it makes more sense to maintain the related posts links in the database, and only recalculate the network of links when posts are created or edited.

That’s the intention behind Efficient Related Posts. Every time you create a blog post, the plugin will store links to other posts — so when you view the post page, no expensive recalculations have to be made.

Of course, if you calculated related posts only for new posts, the only links that would be created would end up going to older posts. Efficient Related Posts gets round that problem by selectively recalculating other posts’ links too. So if you create post A and the plugin determines that it’s related to posts B, C and D, those three posts’ related links will get re-evaluated.

In a blog with thousands of entries, there’s a possibility that the evaluation loop could cause some serious delays. At least by containing those delays to the admin side, your readers will gain the benefit of the related links without any delays in their preparation.

WordPress Wednesday: Custom Post Limits

As I’ve been using WordPress more and more for blogging, I’ve started to get increasingly impressed, especially with the recent 2.7 and 2.8 versions. At work, I’m currently looking for a multi-user platform that can do more than just common-or-garden blogs, and WordPress (or sibling WordPress MU) is a good candidate.

Anyway, there are so many plugins for WordPress that it’s often hard to know which will serve your needs the best.

One that I’ve just implemented is really helpful: Custom Post Limits, written by Scott Reilly.
Continue reading “WordPress Wednesday: Custom Post Limits”