Support » Fixing WordPress » How to exclude files from showing in rss feeds?

  • Resolved dasfgh


    When I checked the feed channel of my site, I noticed that below the post excerpts there’s a download link to the media files (e.g. mp3’s, videos) which are attached to the post. How can I hide them or exclude them from appearing into the feeds? Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • the problem is obviously the custom field automatic enclosure. i try to remove it manually but it comes back by itself. I found a code which maybe can solve the problem, I just don’t know where to put it (it should be in functions.php but where exactly?)

    function delete_enclosure(){
    return '';
    add_filter( 'get_enclosed', 'delete_enclosure' );
    add_filter( 'rss_enclosure', 'delete_enclosure' );
    add_filter( 'atom_enclosure', 'delete_enclosure' );

    I found it. I deleted the “enclosure” custom fields below the post and I leave it without saving the changes and it goes away.

    If you save, wordpress will detect the attached media again and will bring back the “enclosure” custom field automatically.

    I also added the no more enclosures plugin:

    I hope it will prevent the creation of enclosures in the future, as it is said on it’s page

    i published a new post with a video file attached in it and the enclosure custom field appeared again. the plugin didn’t prevent it.
    I deleted the custom field, it didn’t help. Finally, I turned off pinging under the post and the video file disappeared from the feeds

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to exclude files from showing in rss feeds?’ is closed to new replies.