[wp-hackers] Disabling Feeds

Trevor Turk trevorturk at yahoo.com
Mon Sep 12 21:03:54 GMT 2005

I've been looking high and low for a way to disable
feeds (for security) without changing any "core"
files. I'm using the registered_only plugin
and trying to plug the last hole - disabling feeds.

I was looking into plugins, and I think I have
something here that would work. Here's the content of


$disablemessage = '';

function disableFeeds($content) {
    global $disablemessage;
    if(is_feed()) {
        return $disablemessage;
    } else {
        return $content;
add_filter('the_content', 'disableFeeds');


I haven't tested at all, but that's just to give you
an idea of what it would do and what I've been looking
at doing.

HOWEVER, I just realized - you can set the number of
items to show in your feeds via Options -> Reading.
So, I set that option to 0, and now the feeds all seem
to be empty. 

The question is: does setting this option to 0
effectively "disable" all of your feeds?

Obviously, I'd love a way to "protect" instead of
"disable" these feeds, but disabling them is good
enough for now. Most people don't even know what RSS
is anyway...

More information about the wp-hackers mailing list