26 December 2012

Disable Auto-embeds on Wordpress

// // 3 comments
autoembededWordpress is one of the biggest and most popular blogging platform.Serious blogger do prefer this platform a lot.It do have more flexibility than any other blogging platform,even to it's biggest competitor blogger.You can use several eye-catching plugins for your wordpress blog.Wordpress getting popular day by day due to it's most available plugins and user friendly features.Readers do love to visit wordpress blog for it's cool look and many more other attractive features.WordPress 3.5  removes some options from the UI. One of these options is the Embeds section.




oEmbed settings in WordPress 3.4

With that there is not any  visible setting available now, which makes you disable the auto-embed function.However WordPress is not WordPress if it doesn't provide another way to disable it. 



 Must Read : Plugins to Speed Up Wordpress


Disable Auto-embeds



The embed options are handled by the WP Embed class. The constructor of the class registers some actions and filters. Also a filter for the_content:

add_filter( 'the_content', array( $this, 'autoembed' ), 8 );
Now here we just have to remove the specific filter again. Since we can't use $this in the remove_filter call we have to use the global variable $wp_embed that includes the reference to the object.

// Disable auto-embeds for WordPress >= v3.5 remove_filter( 'the_content', array( $GLOBALS['wp_embed'], 'autoembed' ), 8 );


You can also add this code to an existing plugin or you can even allow to use that small  plugin "Auto-embeds Disabler".
Hope it would work perfectly for you,if still you're getting any problem regarding this you ask for help through the below comment box.Thanks for visiting.
Articles You May Like

3 comments: Leave Your Comments

  1. Very helpful! Will disseminate this to my wordpress users friends! :)

    ReplyDelete
  2. This is very helpful as I'm using wordpress for my site.

    ReplyDelete