[wp-hackers] Disabling Feeds

Robert Deaton false.hopes at gmail.com
Mon Sep 12 21:15:01 GMT 2005


There's another simple way to "disable" feeds. Do checks on the uri
that's being requested, if its a feed URI, die out with your message.
If you want to authenticate, do the same thing but replace the die
with code to auth.

On 9/12/05, Trevor Turk <trevorturk at yahoo.com> wrote:
> 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
> (http://carthik.net/blog/vault/2005/05/12/registered-only-plugin-reworked/)
> 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
> it:
> 
> -----
> 
> $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...
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 


-- 
--Robert Deaton
http://somethingunpredictable.com


More information about the wp-hackers mailing list