Get rid of auto media enclosures on WordPress

June 2, 2009 · Print This Article

When you’re adding a multimedia file as such as a mp3 or flv file, WordPress automatically create a custom field named enclosure and add the media url to your rss feed.

Great for podcasters, but unusefull for most bloggers. Let’s see how to get rid of it.

Just paste the following lines of codes within your functions.php file, and then, say goodby to automatic enclosures.

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

Your choice for site templates and wordpress themes


Got something to say?

You must be logged in to post a comment.