WordPress, feeds and titles

Manton Reece has published “Setting up WordPress” to the micro.blog help pages to provide an extended introduction on using the CMS for microblogging.

As microblog posts don’t have titles (just like tweets) he advises to leave them blank and “if necessary update the post template to not include the title in HTML or the RSS feed.” As I’ve outlined elsewhere, I personally don’t like having multiple posts listed as “(no title)” as it makes them difficult to manage in wp-admin.

This is why I decided to automatically replace blank titles with the date/time on posting. As well as being an obvious choice (posts are easily identifiable) micro.blog ignores titles in this format meaning they display correctly. This is fine for micro.blog but what if you want the rest of the world to see no title?

This is where you have to update things to not include the title as I did with the RSS feed and have now also done with my JSON Feed (I completely forgot I had it setup) by editing the plugin to check for post formats in the same way as for RSS.

It may seem like a lot of aggravation adding the title only to remove it again elsewhere but that’s just the way I wanted it set up.

Others have used my solution due to issues such as WordPress automatically inserting the post ID as the title even if it has been left blank. But, as Manton points out:

”You may find that some feed readers don’t gracefully handle posts without titles, often inserting “Untitled” for the title because they expect something to be there. If you see this, the best solution is to email the developer and ask for them to address it. Working around the issue with fake titles — dates, numbers, or portions of the text — will only ensure that client developers never improve their apps to handle title-less posts.”

An item title isn’t listed as a requirement in the RSS spec but most feed readers treat it as such leading to ugly displays. Feedly uses the beginning of the post content which looks particularly awful so, at the end of last year, I submitted this suggestion to their uservoice forum to properly support title-less items.

If there are any Feedly users out there I’d appreciate if you could head on over and vote for this suggestion (it does require you to sign in.) The more votes it receives the more likely they are to consider it for future updates.

  1. manton says: #
    @colinwalker I have a note in my book to link to your title plugin. Decided not to include it in the “getting started” section just because I think it’s more approachable if people start with the basics. WordPress config can quickly get overwhelming, but good for people who are ready for it.
    →†’
  2. colinwalker says: #
    @manton I completely agree. If keeping things as simple as possible works then that’s obviously the way to go. Still, it’s good to have options should we need them 😉 Really looking forward to the book.
    →†’
  3. colinwalker says: #
    @manton I definitely make things more complicated than they need to be but that’s just because of how I want to operate.
    →†’
  4. svenseebeck says: #
    @colinwalker Nice article. I found a very good solution for me by simply turning on “Excerpt View” in the screen options. It still shows the “(no title)” but also the summary of the post. It doesn’t though help in the “add link” search when composing a post. But that’s at least no problem for me.
    →†’
  5. smokey says: #
    @svenseebeck @colinwalker I didn’t realize there were options for that screen, either! Some excerpts leave a bit to be desired, though….

    I keep meaning to file an issue in the WP Trac about making titleless posts appear distinct from each other on the posts screen, given WP supports stuff like status post format and the P2 theme (which Automattic uses heavily, IIRC)—something like “(no title) [post 1234]”…

    →†’
  6. colinwalker says: #
    @manton Just a thought: is it worth mentioning pinging micro.og from WP in the Setting up WordPress guide? People are going to wonder early on if posts don’t come through quickly.
    →†’
  7. manton says: #
    @colinwalker Maybe. I left it out because it’s optional and is mentioned on the Feeds help page. I also have a chapter of my book about real-time feeds that I may try to bring into the help site in some form.
    →†’
  8. clreed87 says: #
    @manton @colinwalker I think it would be worth mentioning. It took me a while to figure out why it was taking my posts so long to update on micro.blog the other night. I eventually found the feeds page though!
    →†’
  9. manton says: #
    @clreed87 Cool, thanks for the feedback. As I’m reviewing the documentation, it is not very prominently linked. Should be on the WebSub page and maybe other places.
    →†’
  10. clreed87 says: #
    @colinwalker Random WordPress ‘code’ question. When you are checking the post format, I’ve been using:

    has_post_format( 'status' )

    And it looks like you use:

    get_post_format()

    Is one better than the other?

    →†’
  11. colinwalker says: #
    @clreed87 They’re both fine just different syntax. I use other get functions elsewhere so it’s just a consistency thing.
    →†’
  12. clreed87 says: #
    @colinwalker Does your ‘pregetpost’ function to auto date Micro.blog posts work from the Micro.blog app? Mine works from ‘wp-admin’ but still shows as ‘(no title)’ when posting from the app.
    →†’
  13. clreed87 says: #
    @smokey @colinwalker Yep—With that filter from wp-admin it works fine. But when I post from the app I still get no title. Adjusted yours slightly–so I’ll try to debug:

    //* Change post title to date if no title is provided
    add_filter( 'title_save_pre', 'minimum_update_blank_title' );
    function minimum_update_blank_title( $title ) {
    if ( empty( $title ) ) {
    $title = get_the_date( 'Y-m-d H.i.s' );
    return $title;
    }
    else {
    return $title;
    }
    }

    →†’
  14. clreed87 says: #
    @smokey @colinwalker Finally figured it out.

    get_the_date()

    was the culprit–I’m guessing because there is no post yet to get the date from when created via the app. Changing it to date() seemed to solve it. Thanks for all the help.

    →†’