Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there a way to disable atom feed and have only rss feed? When I click on the RSS button on my Firefox, I am show 'subscribe to domaintitle using RSS feeds' and 'subscribe to domaintitle using atom feeds'

I do not use a plugin but rather a function.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

The feed links that are included in the HTML code depend on your theme. For example, Twenty Ten only includes one feed type (with two feeds: posts and comments). Check your header.php to see which feeds are referenced there.

If it is a modern theme (like Twenty Ten), you might see no feed links there. This is because WordPress calls feed_links() in wp_head, which will (if the theme supports automatic-feed-links) output links for posts and entries in the default feed format, which is rss2 if you don't change it via the default_feed filter.

Additionally, on some pages like category archives, feed_links_extra() will also output links for a feed for only that category, again in the default feed format.

If you really want to disable a feed (so requests for example.com/atom will no longer work), you can do something like two7s_clash suggested, or play with the rewrite rules so atom is no longer part of the allowed feeds.

share|improve this answer
function disable_our_feeds() {
    wp_die( __('<strong>Error:</strong> No RSS Feed Available, Please visit our <a href="'. get_bloginfo('url') .'">homepage</a>.') );
}

add_action('do_feed_atom', 'disable_our_feeds', 1);
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.