From an Age Gate feature request from @muttznutz, it seemed easier for a new plugin. This simply adds a checkbox to posts and media assets to flag them NSFW. Then, from your theme you can then call: get_nsfw_ids(); Which will return an array of IDs that can be queried against with post__not_in or your own method.