Get it All

I’ve just completed a new plugin, called the Titles to Tags plugin, which I’m sorta proud of. Basically, it checks the title of your post against a list of ignorable words, and then adds tags to your post automatically out of those words that did not appear on the ignore list. The idea is to automatically create a list of relevant keyword tags for your posts. The nice thing is: since I’ve learned to adopt the WordPress API, I’ve found that writing plugins often becomes a much less complex process.

For example, in this plugin, I have to add tags to a post. Obviously, I don’t want to create duplicate tags or create them incorrectly. The new tagging schema is quite complex in the database, and I don’t recommend anyone bother trying to create new tags directly. Instead, I used the wp_add_post_tags() function. This function first checks the current list of tags for the ones I want to add, then if none exist, it creates the tag automatically. This kills both birds with a single stone.

Plus, of course, if the underlying structure of WP should change – and we know it will, eventually – the API will either remain the same or be kept as vestigial, so the plugin doesn’t break because a blog owner did the responsible thing and upgraded to the current version. Another major advantage is that WordPress functions often go through rigorous standards testing and benchmarking, so by using API functions, you’re getting your best shot at creating a highly-compatible and optimized plugin.

Updated to Version 3.0! New Support Page

Titles to Tags is now fully-functional with WordPress 3.0!

I’ve finally found time to wrap by brain around how Tortoise SVN works – which means understanding SVN in the first place, then figuring out how Tortoise’s GUI works – and I’ve updated the plugin after many moons of inactivity. Updates include some revamping of the code based on my experiments with it in another plugin, improved documentation in the plugin itself and bug fixes including the phantom tags commenters have reported.

Download Plugin

Never forget to post your tags again! With the Titles to Tags plugin, WordPress will scan your post’s title for the most keyword-appropriate words and add them to your tags list automatically on save! The plugin comes with a very long list of words which are statistically irrelevant, such as “I” or “among,” which don’t make good keywords. You can also edit this list to include more or less terms by going to Options > Titles 2 Tags. There is also an option to revert to the original list, but watch out! You will lose your edited list forever if you do this!

This plugin will only save tags to your posts if none exist already. The presumption is that if you’ve already saved tags, you must know what you want and anyway, you might have removed some tags Titles to Tags added because you don’t like them. The function runs every time you save a post, either by publishing, saving or editing the post.

To install the plugin, simply download it from the WordPress Plugin Repository, then extract both the hn_titles_to_tags.php file and then hn_t2t and it’s contents into your /plugins folder. Activate the plugin by going to Plugins, and begin posting as normal.

WordPress MU Developers: Note that, if your creating a community-based website built on MU – and your users aren’t being diligent about adding tags – this is a great way to get those tags created painlessly! You can place the file and it’s companion directory in the /mu-plugins file and each blog will get it’s own editable list of ignored words.

And hey! If you like this plugin, I would really appreciate it if you went back to the page and rated it! Thanks!