WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to write a plugin that allows a user to upload a video to Vimeo through the Vimeo upload API.

In order to avoid trying to upload a video to a potentially shared hosting account and then from there to Vimeo I am trying to upload directly to Vimeo through their POST availability - https://developer.vimeo.com/apis/advanced/upload#post

To do this I have to place a form inside of a meta box for a custom post type called 'Vimeo' but wordPress is filtering the tag and it's attributes from the returned HTML source. Is there a way of preventing this or have I taken the wrong approach? I believe I may have a form within a form situation .


share|improve this question
Did you ever get to publishing the code for this? Or, is there a change you can post how you got the upload to work? – hitautodestruct Mar 4 '13 at 12:02
up vote 5 down vote accepted

It's not the right approach, since you are in a post(cpt) edit page the metabox's are simple grouped fields that get attached to the post form and in your case it's actually the browser who is filtering your metabox's form attributes and not WordPress since you are creating nested forms which is something that you just can't do.

A better approach would be to not have the form inside a metabox but outside here is an example using the native thickbox:

First add the button to lanch the thickbox:

//add the button to lanch the thickbox
add_action( 'media_buttons','add_vimeo_upload_button',100);

function add_vimeo_upload_button(){

    global $pagenow,$typenow;   

    if (!in_array( $pagenow, array( 'post.php', 'post-new.php' ) ))
    echo '<a href="#TB_inline?height=155&width=300&inlineId=vimeo_upload" class="thickbox"><img src="http://i.imgur.com/5hyoa.png" alt="Upload to vimeo"></a>';

Add form html outside post form ex:

//add form html outside post form

function vimeo_upload_form(){
    global $pagenow,$typenow;   
    if (!in_array( $pagenow, array( 'post.php', 'post-new.php' )))

//once we get here we are on the right page so we echo form html:
<div id="vimeo_upload" style="display:none">
    <form method="POST" action="vimeo/url">
        <p><label>Upload video to Vimeo</label>
            <input type="file" name="" value="" placeholder=""></p>
        <p><input type="submit" name="" value="upload"></p>

You should get something like this:

  • The media button:

    Upload to vimeo button

  • The form in thickbox:

    Upload to vimeo thickbox

share|improve this answer
Thanks @Bainternet. This looks like it's going to work great and you seem to have gone to quite a lot of trouble to answer this. Thanks loads! – Stewarty Jun 26 '12 at 14:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.