RSS Club for WordPress

This post is secret; it’s only publicised via my RSS feed. Thanks for being part of RSS Club!

I’ve started publishing posts that are only publicised on my RSS feed (and places that syndicate it, I suppose), not on the HTML pages of my blog nor via any social media channels. It’s a concept promoted by Dave Rupert as “RSS Club”. Of it, he says:

What kind of content should you post? Whatever you want. More personal, less personal, weird. It doesn’t matter.

These posts aren’t very “secret”; they’re at publicly-accessible web addresses and linked from a publicly-accessible, promoted feed. But in an era where feed readers don’t enjoy the popularity they once had (and perhaps still ought to have!), it provides a fun and quirky way to artificially reduce the audience that some of your blog posts get. So I’m enjoying playing with it a bit.

I came across the idea via Jim Nielsen‘s blog, and I’ve wanted to get in on the action for a while, but I’d been putting off getting the code in place to support it. Dave uses Jekyll, so he just had to tweak his buildchain to not include his “RSS only” posts. I assume Jim’s process was similar (he’s powered by Metalsmith). But me? I’ve got multiple decades of history in WordPress format, and I can’t see that changing anytime soon, so I needed to roll my sleeves up and get hacky before I could join the club.

I tried Lutz Schröer‘s plugin, which should have “just worked”, but it didn’t: probably because of the huge stack of custom code I’m already running on this site! So instead I came up with my own. My goals were:

  1. Posts with the “rss club” tag should not appear on listing pages, blog search results, previous/next post links, the homepage, or in the “related posts” section.
  2. But these posts should be visible if you go directly to their URL, as well as in RSS feeds, and if you go to the listing page that specifically shows all posts with that tag (incidentally, WordPress takes this setup and ensures I have an RSS feed of just the “RSS only” posts!).

My resulting code turned out tiny – much smaller than the plugin I couldn’t make work – so I just dumped it into my theme’s functions.php. In case it’s any use to you, here it is:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Posts tagged "rss-club" shouldn't appear outside of RSS, so:
// 1. Prevent main queries from returning such posts, except in RSS feeds:
function rss_club_pre_get_posts($query){
  if ( is_admin() ) return; // always see rss club posts in the admin interface
  if ( is_feed() ) return; // always see rss club posts in RSS feeds, duh
  if ( is_tag( 'rss-club' ) ) return; // if we've found the rss-club tag and we're specifically looking for things in it, show them
  $tag = get_term_by('slug', 'rss-club', 'post_tag');
  if ( ! $tag ) return; // if we don't have an rss-club tag, drop out here
  // filter the query:
  $query->set( 'tag__not_in', $tag->term_id );
}
add_action( 'pre_get_posts', 'rss_club_pre_get_posts' );

// 2. Previous prev/next links "skip over" such posts:
function rss_club_prev_next_where($where){
  global $wpdb;
  $secret_post_ids = array_map('array_shift', $wpdb->get_results('SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id=1137', ARRAY_N)); // need to use wpdb so we don't hit our own hook above!
  $secret_post_ids[] = -1; // add a dummy item to ensure the SQL is valid even if there are no secret posts
  $secret_post_ids_list = implode(',', $secret_post_ids);
  // Append our filter onto the query:
  return $where . " AND p.id NOT IN ($secret_post_ids_list)";
}
add_action( 'get_previous_post_where', 'rss_club_prev_next_where' );
add_action( 'get_next_post_where', 'rss_club_prev_next_where' );

The Shape Of Depression

This post is secret; it’s only publicised via my RSS feed. Thanks for being part of RSS Club!

My mental health has good days and bad days. Most days are good days, but bad days tend to cluster together, 2±1 times a year, into a significant low spell. Because I’m keen on developing coping strategies for when I’m not doing so well – and because I’m a nerd – I’ve been trying to understand what a depressive episode looks like. Let’s draw a curve:

Graph showing mood dipping over time, and then climbing again. A point just before the lowest ebb is labelled "A". A point just after that is labelled "B", a point most of the way back up the side is labelled "C".
When life’s a rollercoaster, you make rollercaosterade graphs.

For most of my life, I’ve often only been able to see the shape of the curve as I come out of it; about point “C” on the graph, or even later on. One time, about 12 years ago, I had a bad winter that I couldn’t identify as depression until months after it ended. I just sort-of internalised my sadness and lethargy as “just who I am”; it took a lot of distance before I could say “oh wow; I was really low back then”.

Nowadays I do a lot better: I tend to spot that I’m depressed at about point “A” on the curve. That’s before I hit the bottom, which helps with taking steps to mitigate the worst of it (talk, diet, mindfulness, exercise, sunlight, etc. as applicable).

It’s still not as soon as I’d like, but better self-awareness will, I hope, keep pushing point “A” earlier and earlier. The challenge is, of course – as any data scientist can tell you – not getting distracted by false maxima/minima:

Graph showing a portion of the "downhill" section of the earlier graph, but instead of going down across its entire length, it goes down, then up again, then plunges down once more, creating a local maxima.
Zoom and enhance! The smooth ride downhill at point “A” might be bumpier up-close.

Getting to point “A”, making positive steps to try to course-correct, and then feeling better for a few days doesn’t necessarily mean I’m on the up-and-up, and that’s dispiriting. But still: having the full curve to-hand serves as a reassuing reminder that, in the end, I’ll come “up” the other side, as I have time and again. This too shall pass, and all that.

Point “B” is where I often get sick, as a reminder that psychological and physical health so often go hand-in-hand. It’s a bit disheartening that I’m usually right at the point where I’m thinking “hey, things are getting better” and then the next day come down with a cold or something, but at least it’s on the right hand side of the curve. I’m acutely aware of this part of the process because I got sick early this week and I’m still not quite feeling myself again, but still: at least I’m on the up-swing of the curve.

I’ve gotten to be moderately good at spotting the whys that act as harbingers to upcoming low spells. So now I’m focussed on understanding the hows of what it’s like to enter and leave them. Maybe someday I’ll be good enough at making course-corrections, early enough, that I can flatten out these graphs. But for now, I’m going to get back to my point-“B”-to-“C” self-care.

Update: turns out that what I was coming down with at point “B” this time was Covid. Delightful.