The Blog
Ninjas For Hire

Ninja Embed WordPress Plugin

We’ve been doing a lot of WordPress projects recently and one thing stood out as something we needed to enable us to provide our clients with an easier way to embed media in their posts and pages.

We decided to create a WordPress plugin that would not only allow the user to easily embed media from YouTube, Vimeo, Yahoo Video and Soundcloud into their posts, but also allow us as developers to use it as a function in the our WordPress template files to embed videos in custom content types and other filters.

The plugin currently supports YouTube, Vimeo, Yahoo Video and Soundcloud. We hope to be able to add more online media services soon.


  1. Copy the PHP file from the zip file at the bottom of this post into your WordPress “plugins” folder.
  2. Log in to your installation of WordPress.
  3. Go to the “Plugins” menu and activate the plugin called “Ninja Embed Plugin”
  4. Enjoy!

How do users use it?

To embed a piece of media in a post or page you simply need to add the following shortcode to you post or page content:

[media link=”″]

You can also set a custom width and height to your media by adding the width and height parameters to the shortcode:

[media width=”800″ height=”600″ link=”″]

You can remove the container around the embed code by setting the container to false(default is true):

[media container=”false” link=”″]


As of version 2.0 you can now easily embed video in your site’s widgetized areas (like the sidebar) using the new Ninja Embed Widget that is now included in this plugin.

How do developers use it?

Don’t worry, we did not forget about the developers. πŸ™‚

To embed a piece of media somewhere in the code you simply need to add the following function to the template:


You can also set a custom width and height to the media by adding arguments for width and height respectively:

media_embed(‘’, 800, 600)

It is also possible to remove the container around the embed code you can set the container to false(default is true):

media_embed(‘’, 800, 600, false)

OR if you don’t want to set the width and height and just remove the container

media_embed(‘’, ”, ”, false)

Download the plugin!

You can download the plugin straight from the official WordPress plugin page here:


17 Responses

  1. Anton says:

    It would be great if you make graphic interface for users. Also in my project would be perfect to get dimensions of video and with referencing to static width calculate right height. But not because of this I am writing to you. I am writing cause media has embeded on the top of posts. What about description text under each video? For now it is impossible. Help. Please. I look forward to your reply.

    Thank you.

  2. Ninjas for Hire says:


    Thank you for the feedback πŸ™‚

    The main plan for a future release is a page when the user can set up their media embed tag using the URL of the media they want to embed and the dimensions.

    Adding an automatic calculation to get the media height from the width or vice versa is not something we though of before, but definitively something we will think about and try to include. The plugin also support Soundcloud that doesn’t have different heights, so something like this will be a little more tricky than it appears on the surface.

    Description text is another thing we didn’t consider as the current tag only makes it easier to use the standard embed HTML of the supported media services. Currently you will need to add the description manually and maybe style it with some custom CSS. I will however look into this as it might be very useful. πŸ™‚

  3. Andrew says:

    The following is an error message I am getting … can you help?

    Deprecated: Function ereg() is deprecated in /home/content/92/9831392/html/wp-content/plugins/ninja-embed-plugin/ninja_embed_plugin.php on line 138

    Deprecated: Function ereg() is deprecated in /home/content/92/9831392/html/wp-content/plugins/ninja-embed-plugin/ninja_embed_plugin.php on line 141

  4. Ninjas for Hire says:


    We updated this for you and if you click update on the plugin in WordPress this problem should now be resolved. πŸ™‚

  5. Lukasz says:

    Using it on the site wow this is the best plugin on planet !!! THAN’s NINJA !!! HAGGGGAAA !….

  6. Agus Salim says:

    Hallo, please tell me how to embed Soundcloud use Ninja Plugin,

    Thanks, πŸ™‚

  7. Ninjas for Hire says:


    To embed a Souncloud clip using the Ninja Embed plugin, you will need to get the direct link to the clip.

    In your post you can now just use the following shortcode like this:

    [media link=”″]

    If the plugin is activated and you have a theme that is built correctly, you should now see the Souncloud clip on your site.

    Thank you for using Ninja Embed! πŸ™‚

    • Filipe says:

      Is there a option to auto play the music from sound cloud?

      • Ninjas for Hire says:

        Hello Filipe

        This isn’t currently an option, but will definitely be in the next revision of the plugin.

        Thanks for the feedback! πŸ™‚

    • Deb says:

      I’m using ninja embed in p3 and up to now it’s worked a charm. Is there an issue with private soundcloud shares?
      [embed link=""]
      just gets me this message in the widget:
      `url` parameter is not a valid SoundCloud URL. Learn more about using SoundCloud embeds

      • Ninjas for Hire says:

        Hello Deb

        Soundcloud files needs to be set to public in order to share them. Private shares won’t display on a public embed. πŸ™‚

  8. Joanne says:

    ο»ΏWow! I’m really enjoying the style and design of your weblog. Are you using a custom made theme or is this freely available to all users? If you don’t want to say the name of
    it out in the general public, please contact me. I’d really enjoy to get my hands on this theme! Cheers.

    my page … Joanne

  9. Ratna says:

    Hey! How do I allign the video to center? It is alligned left when I enter the code. Thank you πŸ™‚

    • Ninjas for Hire says:

      Hello Ratna

      If the container is set to true you can simply give it a width and set the margin on the left and right to “auto” in your CSS file πŸ™‚

  10. mehr... says:

    What’s up to every one, the contents present at this website
    are actually awesome for people experience, well, keep up the good work fellows.

  11. Juan says:

    Love the Plug in!! thanks guys… question.
    How can I make the video start playing when opening the site?

    • Ninjas for Hire says:

      Hello Juan

      This isn’t currently an option, but will definitely be in the next revision of the plugin.

      Thanks for the feedback! πŸ™‚

Leave a Response to Ninjas for Hire