How to remove enclosure from Wordpress posts?

January 2013 WordPress Theme
GK User
Tue Jun 18, 2013 5:13 pm
I am starting to use a news world theme and got into trouble. As soon as I include audio/video file into post Wordpress create enclosure automatically.

Looks like this:

enclosure:
-----------------------.com/a_33/a_33_3/a_33_3_1.mp3 44695719 audio/mpeg

Does anyone know how to get rid of this?
Thanks
User avatar
Fresh Boarder

GK User
Wed Jun 19, 2013 7:28 am
Hi,

You can hide this and other custom post fileds in News -> Template Options -> Advanced tab.
Type "enclosure" in Hidden Custom Post Fields text area and save settings.
Article about unwanted Custom Post Fileds.
User avatar
Moderator

GK User
Wed Jun 19, 2013 11:00 pm
Thanks
Yes, this is helpful solution for the frontend, but even if you hide or disable, enclosures are still going to be filling out database. Is there any ways to remove the function that create them?

I tried to use this function but it seems not to work in 3.5 version
function delete_enclosure(){
return '';
}
add_filter( 'get_enclosed', 'delete_enclosure' );
add_filter( 'rss_enclosure', 'delete_enclosure' );
add_filter( 'atom_enclosure', 'delete_enclosure' );

Thanks
User avatar
Fresh Boarder

GK User
Thu Jun 20, 2013 9:50 am
In wp-includes/functions.php is a function do_enclose which checks content for video and audio links to add enclosures, maybe try to edit or delete this function, but it's a interference with WP core.
User avatar
Moderator


cron