SOLVED – YouTube or Other Videos Not Embedding in WordPress MU Posts

If you are a WordPress MU administrator and getting complaint that your users are not able to upload or embed YouTube videos or any other video in posts then here is the solution to do that. In WordPress MU, when you will try to embed the code of YouTube video, it will disappear after hitting the ‘Publish’ button. To embed YouTube video or any other video, you will have to make some code changes in WordPress MU file.

In WordPress MU setup, under ‘wp-include’ folder, you can find ‘kses.php’ file. You will have to edit that file to enable YouTube or Other videos embed feature in WordPress MU posts. Open ‘kses.php’ file on editor and make the below changes into that file. First of all try to find the code (in black color) on kses.php file. These changes will enable your WordPress MU editor to embed videos like YouTube and Vimeo.

After the below piece of code;

 'ol' => array (
    'class' => array (),
    'start' => array (),
    'style' => array (),
    'type' => array ()),

Add the below mentioned code,

    'embed' => array (
    'style' => array (),
    'type' => array (),
    'id' => array (),
    'height' => array (),
    'width' => array (),
    'src' => array ()),
'object' => array (
    'height' => array (),
    'width' => array ()),
    'param' => array (
    'name' => array (),
    'value' => array ()),
    'object' => array(
    'width' => array (),
    'height' => array (),
    'movie' => array (),
    'allowFullScreen' => array (),
    'embed src' => array(),
    'application/x-shockwave-flash' => array()),

Save the ‘kses.php’ file and upload it to your server. Now you can embed a video (for example YouTube) code and publish the post. Now your post will show the newly embedded video in proper way. You may add other type of media tags to add them in your posts on MU.

Related: Enable Theme and Plugin Editor on WordPress MU

Print This Post
RSS for Internet Techies Hello there! If you are new here, you might want to subscribe to the RSS feed for updates.

Featured Jobs On Internet Techies
Digital Media Marketing Specialist at Signature Fencing & Flooring Systems, LLC (New York, New York) : Digital Media Marketing Specialist We are seeking an Digital Media Marketing Specialist who is an expert in the field of SEO/SEM, Social Media marketing and email marketing who can design and impleme...
Sr ETL Developer /Informatica Expert at Leading Interactive Digital Agency (New York, New York) : We are a leading interactive digital agency who partners with media, entertainment, and hospitality brands to create new business capabilities that maximize the opportunities of the digital age. The e...
16 Responses to “SOLVED – YouTube or Other Videos Not Embedding in WordPress MU Posts”
  1. This is very useful post for me. Actually many time i tried to add video from youtube but could not. Here i got the perfect solution. Thanks buddy.

  2. Why does WP MU not come out with that already done? Just asking as I know many don’t like editing WP files, to afraid to make the change and then they have to edo the change when a new version comes out.

  3. LaVonne says:

    This looks great, thanks–but I’m wondering what happens when it’s time to upgrade MU. Do we have to re-upload this file every time we upgrade?

  4. anony says:

    Its dangerous coz this code allow XSS!

  5. I’ve been looking at downloading videos from YouTube, it seems that YouTube and many other social network sites have changed their code in order to prevent certain sites from allowing you to download video content from them; most annoying, is there a foolproof alternative? Anyway, excellent blog post, I found it very insightful

  6. Andrea_R says:

    Sorry, this is NOT recommened. Do not hack the core, when there are plugins to do this for you.

    Also, new in 2.9.1 video embeds are built in and enabled for MU.

  7. No Way says:

    What is with WordPress anyway… I mean if this program is this vulnerable maybe it’s time to go elsewhere’s

    Anyway, I tried your fix and was able to embed a video but I believe it was an .rm flavor and I had no controls over the video (play etc)

    Then, I went and followed Andrea’s advice and downloaded some german guys plugin that did absolutely not a thing….

    Help Please!!!!

  8. Venugopal says:

    Sanjeev,

    Thanks for this. I do have WP MU 2.9.1 installed. I tried embedding viedos on my webpage . It still doesent show up on the post as embedded. It only shows up as a link . However one link showed up as embedded the others are not . I even tried what you recommed ed up here . Still it doesent seem to fix the issue. Can you suggest what could be the problem

    Regards

    Venu
    http://forexwecan.com/wordpress-MU/myblog/2010/01/20/video/

    • Hi Venugopal,

      You can send us the details of you site. or you can contact us thru Skype (clickonf5). We will look into your issue and will be happy to help you on that.

  9. Karen Hayes says:

    Youtube is my favortie site to visit aside from facebook. most of the time i watched movie trailers and music videos on it.

  10. Alex says:

    very helpful! thanks

  11. Perk says:

    The code is not keeping a portion clean:
    <embed src="http://www.pbs.org/wgbh/pages/frontline/video/flv/generic.html?s=frol02p79&continuous=1

    The <embed src=" is being changed to: <embed src="

    I copy the entire file and saved it. Any Suggestions:

    • Perk says:

      Your site change the code back to the original.

      This is the code: close the space: & lt;embed src=& quot;

  12. Vishal says:

    I have fixed the bug using above guidline in kses.php but still not able to display the flash embaded youtube video in wordpress forum posts even if it stores the thing as in the database
    “hello,

    Any idea how to solve this?I use BP-tinymce editor to post the forum posts.

  13. obiavi says:

    Works fine on WordPress MU 2.9.2. You save me :). Thanks!

  14. Thanks a lot Sanjeev.

Sorry, the comments are closed on this page. Please use the below link to post us a query.