homepage Welcome to WebmasterWorld Guest from 54.227.20.250
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / WordPress
Forum Library, Charter, Moderators: lorax & rogerd

WordPress Forum

    
How Do I Completely Disable RSS Feeds In Wordpress?
Sgt_Kickaxe

WebmasterWorld Senior Member sgt_kickaxe us a WebmasterWorld Top Contributor of All Time



 
Msg#: 4518227 posted 2:45 am on Nov 12, 2012 (gmt 0)

I have a wordpress blog that will receive changes to existing pages but will not require new pages, making feeds useless. Several sites have begun using the feed and I'm having to file DMCA complaints to restore the rankings in the pages that appear in the feed. I've tried the following but none of the following is fully successful.

- Delete core files related to feeds. Causes too many errors.

- Set the number of posts to display in a feed to 0 in ucp. Wordpress replaces 0 with 1 and displays one entry.

- return 404 in htaccess for any url ending in /feed. Host will not allow that url to be blocked(!?!).

- assign "RedirectMatch Gone" in htaccess for any url ending in /feed. Returns a 500 error which isn't ideal(!?!).

- use the following code to disable ALL feeds and redirect any feed access to the base url. Partial success, most feeds disabled, but does NOT work for root domain(example.com/feed) which is most important.

if( !defined( 'ABSPATH' ) )
exit;
class Disable_Feeds {
function __construct() {
if( ! is_admin() ) {
add_action( 'wp_loaded', array( $this, 'remove_links' ) );
add_filter( 'template_redirect', array( $this, 'filter_query' ), 9 );// before redirect_canonical
}
}
function remove_links() {
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'feed_links_extra', 3 );
}
function filter_query() {
if( !is_feed() )
return;
if( isset( $_GET['feed'] ) ) {
wp_redirect( remove_query_arg( 'feed' ), 301 );
exit;
}
set_query_var( 'feed', '' );
}
}
new Disable_Feeds();


I'm stumped. Wordpress seems to have implemented MANY levels of feed redundancy in various wordpress files and honestly any of the above SHOULD have worked but workarounds have been implemented in wordpress to get around each of them. Why my host would refuse to allow a 404 page or redirect to be placed on urls ending in /feed when I can add them to any other url is beyond me.

Note: I have already removed the feed links from the header file but this, obviously, does not disable the feeds. I need the site to no longer have ANY feeds be created for any content. Yes I've made sure I'm not seeing cached content etc, etc.

Honestly turning off feeds should be an option in the control panel but it's not, quite the opposite. Suggestions?

 

Sgt_Kickaxe

WebmasterWorld Senior Member sgt_kickaxe us a WebmasterWorld Top Contributor of All Time



 
Msg#: 4518227 posted 4:04 am on Nov 12, 2012 (gmt 0)

Also tried...

- creating a post with the url /feed in hopes of having it override the site feeds. No luck, wordpress changes the url to /feed-2 even though there is no article with the url /feed on the site. It's a protected url, apparently.

netmeg

WebmasterWorld Senior Member netmeg us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



 
Msg#: 4518227 posted 11:18 pm on Nov 14, 2012 (gmt 0)

Have you looked at this?

[wordpress.org...]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / WordPress
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved