Support » Fixing WordPress » Remove links from titles of posts

  • benjiw33


    I have a blog that I am essentially using as a backend for and RSS feed that gets processed into an email digest. I’d like to remove the title links from SOME posts so that they aren’t included in the RSS feed, and hence the email that goes out. In other words, I want the RSS feed to contain only the post title and body, but no link back to the post in some instances.

    I’ve searched and searched but can’t find a way to do this. Any help is much appreciated. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • t31os


    I think (in that i’m not totally sure), you might be able to do somthing like this…

    <?php if(is_feed()) { echo the_title_attribute(); } else { the_title(); } ?>

    The title attribute as far as i can see only returns the title…

    This would replace your existing..

    <?php the_title(); ?>

    I’m not hugely familiar with how feeds work in WP, so i could be wrong, but give it a shot…



    Thanks — but wouldn’t this change it so that none of the posts have title links? I only want this to apply to certain posts. Thanks much for your insight.



    It would change it for all posts when viewed as a feed, i think…

    If you want it for a particular category then maybe something like…

    <?php if(is_feed() && is_category('yourcat')) { echo the_title_attribute(); } else { the_title(); } ?>

    Or you might need to use in_category…

    <?php if(is_feed() && in_category('yourcat')) { echo the_title_attribute(); } else { the_title(); } ?>

    Like i said, i’m not fully aware of how the WP feed functions work, so the above may not work at all. Give it a shot, if it doesn’t work then just change it back…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove links from titles of posts’ is closed to new replies.