• I’m trying to disable tag RSS feeds with functions.php code.

    This article describes what I’m trying to achieve, but it appears to be out of date.

    https://www.lostsaloon.com/technology/disable-category-and-tag-rss-feeds-in-wordpress/

    Does anyone know how this can be achieved with the current version of WordPress?

    Thanks.

    • This topic was modified 3 years, 4 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 1 replies (of 1 total)
  • == Update codes ==

    For Categories:

    /**
     * Disable the feed link for the post category
     *
     * @param string $link Feed Link.
     * @return bool
     */
    function wp_custom_disable_category_feed_link( $link ) {
    	return false;
    }
    add_filter( 'category_feed_link', 'wp_custom_disable_category_feed_link' );

    For Tags:

    /**
     * Disable the feed link for the post tag
     *
     * @param string $link Feed Link.
     * @return bool
     */
    function wp_custom_disable_tag_feed_link( $link ) {
    	return false;
    }
    add_filter( 'tag_feed_link', 'wp_custom_disable_tag_feed_link' );

    For Taxonomies:

    /**
     * Disable the feed link for the post taxonomy
     *
     * @param string $link Feed Link.
     * @param string $feed Feed type.
     * @param string $taxonomy Taxonomy slug.
     * @return bool
     */
    function wp_custom_disable_taxonomy_feed_link( $link, $feed, $taxonomy ) {
    	if ( 'custom_taxonomy_name' === $taxonomy ) {
    		return false;
    	}
    }
    add_filter( 'taxonomy_feed_link', 'wp_custom_disable_taxonomy_feed_link', 10, 3 );
Viewing 1 replies (of 1 total)
  • The topic ‘How can I disable tag rss feeds’ is closed to new replies.