Welcome to WebmasterWorld Guest from 50.19.156.133

Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

How Do I Completely Disable RSS Feeds In Wordpress?

     

Sgt_Kickaxe

2:45 am on Nov 12, 2012 (gmt 0)

WebmasterWorld Senior Member sgt_kickaxe is a WebmasterWorld Top Contributor of All Time 5+ Year Member



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

4:04 am on Nov 12, 2012 (gmt 0)

WebmasterWorld Senior Member sgt_kickaxe is a WebmasterWorld Top Contributor of All Time 5+ Year Member



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

11:18 pm on Nov 14, 2012 (gmt 0)

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



Have you looked at this?

[wordpress.org...]
 

Featured Threads

Hot Threads This Week

Hot Threads This Month