Support » Fixing WordPress » Disable the native default rss feed

  • Hello,

    I created my own rss feed that can be reached by both url mysite.fr/?feed=flux-rss and mysite.fr/flux-rss. The problem is that when using services like feedly, the rss feed that is taken in account is the native default rss feed (reached on mysite.fr/feed/). I solved this by creating a redirection in root .htaccess file (redirect /feed/ to /flux-rss) but I would like to avoid this and to know if there is a way to disable the WP generated default rss feed.

    Thanks in advance ๐Ÿ™‚

Viewing 3 replies - 1 through 3 (of 3 total)
  • Is that the right way?

    remove_action( 'do_feed_rdf', 'do_feed_rdf', 10, 1 );
    remove_action( 'do_feed_rss', 'do_feed_rss', 10, 1 );
    remove_action( 'do_feed_rss2', 'do_feed_rss2', 10, 1 );
    remove_action( 'do_feed_atom', 'do_feed_atom', 10, 1 );

    Found here : http://www.456bereastreet.com/archive/201103/controlling_and_customising_rss_feeds_in_wordpress/

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    The right way depends on a lot on what is in your theme already.

    Does your theme’s functions.php file contain this line of code?

    add_theme_support( 'automatic-feed-links' );

    If so, you can comment that out or remove it to disable the hidden feed links in the header. This will prevent services from finding those feeds through normal means.

    Hi Samuel and thanks for that reply.

    No, my theme doesn’t content this line and I added my custom feed link in my header file this way for a while :
    <link rel="alternate" type="application/rss+xml" title="My site ยป Flux RSS" href="<?php echo home_url( '/' ); ?>flux-rss" />
    This doesn’t seem to avoid the /feed/ to be catch by feedly…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disable the native default rss feed’ is closed to new replies.