WordPress.org

Ready to get started?Download WordPress

Forums

Disable the native default rss feed (4 posts)

  1. jojaba
    Member
    Posted 3 months ago #

    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 :)

  2. jojaba
    Member
    Posted 3 months ago #

    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/

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 3 months ago #

    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.

  4. jojaba
    Member
    Posted 3 months ago #

    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...

Reply

You must log in to post.

About this Topic