Temporary fix for WordPress 3 agressive HTML filtering

If you’re having problems posting flash content (such as YouTube videos) into posts and pages under WordPress 3 and until the unfiltered_mu plugin has been updated then here is a fix you can use.

Open /wp-includes/kses.php and add these array items to the $allowedposttags array (around line 43):

	'embed' => array(
		'width' => array(),
		'height' => array(),
		'id' => array(),
		'align' => array(),
		'src' => array(),
		'FlashVars' => array(),
		'quality' => array(),
		'bgcolor' => array(),
		'name' => array(),
		'allowScriptAccess' => array(),
		'allowFullScreen' => array(),
		'type' => array(),
		'pluginpage' => array()
	),
	'object' => array(
		'width' => array(),
		'height' => array(),
		'id' => array(),
		'align' => array()
	),
	'param' => array(
		'name' => array(),
		'value' => array(),
	),

One thought on “Temporary fix for WordPress 3 agressive HTML filtering

  1. I wonder if this is because MU didn’t have unfiltered_html, and when you upgraded the capability wasn’t added to the admin/editor roles?

    Unfortunately the filter used by the unfiltered_mu plugin was removed in WP 3.0 which is why it broke.

Leave a Reply

Your email address will not be published.