WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Removing Automatic feed links from header (3 posts)

  1. igorx81
    Member
    Posted 1 year ago #

    Hi, I've tried to modify some files in wp-includes but with no result.

    How can I remove the whole line

    <link rel="alternate" type="application/rss+xml" title="Site Title ยป Post Title Comments Feed" href="http://www.site.com/posturl/feed/" />

    from each post header?

    Thank you.

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    No! Never, ever, edit WordPress core scripts. And do not encourage others to do so. Editing core scripts can bring down your entire site and/or open security holes for hackers to use.

    Re-upload a fresh copy of the wp-includes folder then try adding:

    // Remove auto generated feed links
    function my_remove_feeds() {
    	remove_action( 'wp_head', 'feed_links_extra', 3 );
    	remove_action( 'wp_head', 'feed_links', 2 );
    }
    add_action( 'after_setup_theme', 'my_remove_feeds' );

    to your theme's functions.php file.

  3. igorx81
    Member
    Posted 1 year ago #

    Thanks a lot.

Topic Closed

This topic has been closed to new replies.

About this Topic