Title: Problem with &#8220;the_content_rss&#8221; hook
Last modified: August 19, 2016

---

# Problem with “the_content_rss” hook

 *  [skarcha](https://wordpress.org/support/users/skarcha/)
 * (@skarcha)
 * [18 years, 2 months ago](https://wordpress.org/support/topic/problem-with-the_content_rss-hook/)
 * Hi,
 * I’m doing a test plugin using “the_content_rss” hook to filter the content of
   posts, but my function is never called.
 * If I use “the_content” or “the_title_rss”, it works. What’s the problem here?.
 * This is the code:
 *     ```
       <?php
       /*
       Plugin Name: TestRSS
       Plugin URI:
       Description: Test plugin
       Version: 0.1
       Date: Mar 31th, 2008
       Author: Antonio Perez
       Author URI:
       */
   
       function test_rss($text)
       {
       	$text = "Hello world";
       	return $text;
       }
   
       add_filter('the_content_rss', 'test_rss');
       ?>
       ```
   
 * Thanks in advance for your answer.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/problem-with-the_content_rss-hook/#post-726162)
 * I am having the same problem.
 * A workaround would be to use ‘the_content’ filter and is_feed() conditional tag,
   but it gets annoying to know that you could use a hook, if it was functioning.
 *  [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/problem-with-the_content_rss-hook/#post-726177)
 * Submitted [ticket 6847](http://trac.wordpress.org/ticket/6847).
 *  [mystyman](https://wordpress.org/support/users/mystyman/)
 * (@mystyman)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/problem-with-the_content_rss-hook/#post-726205)
 * hi, I just submitted a patch on that ticket which uses is_feed() inside the_content()
   function to run the the_content_rss hook when appropiate. The issue is appearently
   the rss2 and atom feeds go through the_content() instead of the_content_rss().
   Anyway patch needs testing.
 *  Thread Starter [skarcha](https://wordpress.org/support/users/skarcha/)
 * (@skarcha)
 * [18 years ago](https://wordpress.org/support/topic/problem-with-the_content_rss-hook/#post-726217)
 * It works now!. Thanks mystyman.
 *  [tadhg](https://wordpress.org/support/users/tadhg/)
 * (@tadhg)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/problem-with-the_content_rss-hook/#post-726288)
 * That ticket ([6847](http://core.trac.wordpress.org/ticket/6847)) has been closed
   as “invalid”, but I don’t understand why–I suspect that the person who closed
   it didn’t realize that it doesn’t seem to work with Atom or RSS2 because of [http://core.trac.wordpress.org/ticket/8706](http://core.trac.wordpress.org/ticket/8706).
   
   The patch that mystyman suggested works because of the inconsistency in 8706;
   the person who marked 6847 invalid is correct about how it /should/ work, but
   not about how it currently /does/ work, and until 6847 is fixed mystyman’s patch
   looks like the right answer to me.
 * Also, here’s another forum thread on it:
    [http://wordpress.org/support/topic/192997](http://wordpress.org/support/topic/192997).

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Problem with “the_content_rss” hook’ is closed to new replies.

## Tags

 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [RSS](https://wordpress.org/support/topic-tag/rss/)
 * [the_content_rss](https://wordpress.org/support/topic-tag/the_content_rss/)

 * 5 replies
 * 4 participants
 * Last reply from: [tadhg](https://wordpress.org/support/users/tadhg/)
 * Last activity: [17 years, 2 months ago](https://wordpress.org/support/topic/problem-with-the_content_rss-hook/#post-726288)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
