Title: feed_links
Published: April 25, 2014
Last modified: August 20, 2026

---

# feed_links( array $args = array() )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#wp--skip-link--target)

Displays the links to the general feeds.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#parameters)󠁿

 `$args`arrayoptional

Optional arguments.

Default:`array()`

## 󠀁[Source](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#source)󠁿

    ```php
    function feed_links( $args = array() ) {
    	if ( ! current_theme_supports( 'automatic-feed-links' ) ) {
    		return;
    	}

    	$defaults = array(
    		/* translators: Separator between site name and feed type in feed links. */
    		'separator' => _x( '&raquo;', 'feed link' ),
    		/* translators: 1: Site title, 2: Separator (raquo). */
    		'feedtitle' => __( '%1$s %2$s Feed' ),
    		/* translators: 1: Site title, 2: Separator (raquo). */
    		'comstitle' => __( '%1$s %2$s Comments Feed' ),
    	);

    	$args = wp_parse_args( $args, $defaults );

    	/**
    	 * Filters the feed links arguments.
    	 *
    	 * @since 6.7.0
    	 *
    	 * @param array $args An array of feed links arguments.
    	 */
    	$args = apply_filters( 'feed_links_args', $args );

    	/**
    	 * Filters whether to display the posts feed link.
    	 *
    	 * @since 4.4.0
    	 *
    	 * @param bool $show Whether to display the posts feed link. Default true.
    	 */
    	if ( apply_filters( 'feed_links_show_posts_feed', true ) ) {
    		printf(
    			'<link rel="alternate" type="%s" title="%s" href="%s" />' . "\n",
    			feed_content_type(),
    			esc_attr( sprintf( $args['feedtitle'], get_bloginfo( 'name' ), $args['separator'] ) ),
    			esc_url( get_feed_link() )
    		);
    	}

    	/**
    	 * Filters whether to display the comments feed link.
    	 *
    	 * @since 4.4.0
    	 *
    	 * @param bool $show Whether to display the comments feed link. Default true.
    	 */
    	if ( apply_filters( 'feed_links_show_comments_feed', true ) ) {
    		printf(
    			'<link rel="alternate" type="%s" title="%s" href="%s" />' . "\n",
    			feed_content_type(),
    			esc_attr( sprintf( $args['comstitle'], get_bloginfo( 'name' ), $args['separator'] ) ),
    			esc_url( get_feed_link( 'comments_' . get_default_feed() ) )
    		);
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/general-template.php#L3455)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/general-template.php#L3455-L3511)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#hooks)󠁿

 [apply_filters( ‘feed_links_args’, array $args )](https://developer.wordpress.org/reference/hooks/feed_links_args/)

Filters the feed links arguments.

 [apply_filters( ‘feed_links_show_comments_feed’, bool $show )](https://developer.wordpress.org/reference/hooks/feed_links_show_comments_feed/)

Filters whether to display the comments feed link.

 [apply_filters( ‘feed_links_show_posts_feed’, bool $show )](https://developer.wordpress.org/reference/hooks/feed_links_show_posts_feed/)

Filters whether to display the posts feed link.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#related)󠁿

| Uses | Description | 
| [get_feed_link()](https://developer.wordpress.org/reference/functions/get_feed_link/)`wp-includes/link-template.php` |

Retrieves the permalink for the feed type.

  | 
| [feed_content_type()](https://developer.wordpress.org/reference/functions/feed_content_type/)`wp-includes/feed.php` |

Returns the content type for specified feed type.

  | 
| [get_default_feed()](https://developer.wordpress.org/reference/functions/get_default_feed/)`wp-includes/feed.php` |

Retrieves the default feed.

  | 
| [current_theme_supports()](https://developer.wordpress.org/reference/functions/current_theme_supports/)`wp-includes/theme.php` |

Checks a theme’s support for a given feature.

  | 
| [_x()](https://developer.wordpress.org/reference/functions/_x/)`wp-includes/l10n.php` |

Retrieves translated string with gettext context.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [esc_attr()](https://developer.wordpress.org/reference/functions/esc_attr/)`wp-includes/formatting.php` |

Escaping for HTML attributes.

  | 
| [esc_url()](https://developer.wordpress.org/reference/functions/esc_url/)`wp-includes/formatting.php` |

Checks and cleans a URL.

  | 
| [get_bloginfo()](https://developer.wordpress.org/reference/functions/get_bloginfo/)`wp-includes/general-template.php` |

Retrieves information about the current site.

  | 
| [wp_parse_args()](https://developer.wordpress.org/reference/functions/wp_parse_args/)`wp-includes/functions.php` |

Merges user defined arguments into defaults array.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

[Show 8 more](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/feed_links/?output_format=md#comment-content-7636)
 2.   [Pilar Mera](https://profiles.wordpress.org/decrecementofeliz/)  [  2 days ago  ](https://developer.wordpress.org/reference/functions/feed_links/#comment-7636)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Ffeed_links%2F%23comment-7636)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Ffeed_links%2F%23comment-7636)
 4. **Remove the feed links (RSS autodiscovery) from the head**
 5.     ```php
        // Remove the links to the "last posts" and "last comments" feeds 
        remove_action( 'wp_head', 'feed_links', 2 );
    
        // Remove the links to the single posts comments, custom post types, taxonomies, authors and searchs feeds
        remove_action( 'wp_head', 'feed_links_extra', 3 );
    
        // Remove each feed link independently:
        add_filter( 'feed_links_show_posts_feed', '__return_false' );
        add_filter( 'feed_links_show_comments_feed', '__return_false' );
        add_filter( 'feed_links_extra_show_post_comments_feed', '__return_false' );
        add_filter( 'feed_links_extra_show_post_type_archive_feed', '__return_false' );
        add_filter( 'feed_links_extra_show_tag_feed', '__return_false' );
        add_filter( 'feed_links_extra_show_category_feed', '__return_false' );
        add_filter( 'feed_links_extra_show_tax_feed', '__return_false' );
        add_filter( 'feed_links_extra_show_author_feed', '__return_false' );
        add_filter( 'feed_links_extra_show_search_feed', '__return_false' );
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Ffeed_links%2F%3Freplytocom%3D7636%23feedback-editor-7636)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Ffeed_links%2F)
before being able to contribute a note or feedback.