Title: iframe code deleted
Last modified: August 19, 2016

---

# iframe code deleted

 *  [William Bowles](https://wordpress.org/support/users/creative-i/)
 * (@creative-i)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/iframe-code-deleted/)
 * Every time I insert iframe code into a post it gets deleted (whether in source
   or ‘wysiwyg’ mode.

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [Bill Erickson](https://wordpress.org/support/users/billerickson/)
 * (@billerickson)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/iframe-code-deleted/#post-1935810)
 * If you must insert it in the editor, disable the visual editor in Users > Your
   Profile before putting it in there.
 * Although a better way would be to turn the iframe into a shortcode so you could
   keep using the editor. A shortcode is a simple bracketed phrase that WordPress
   will replace with actual code when rendered.
 * So if you put [my-iframe] in your visual editor, you could go to your functions.
   php and type this (make sure to back it up and be able to access it via FTP. 
   If you make any mistakes your site will be inaccessible).
 *     ```
       add_shortcode('my-iframe', 'my_iframe_shortcode');
       function my_iframe_shortcode() { ?>
       <iframe code goes here>
       <?php }
       ```
   
 *  Thread Starter [William Bowles](https://wordpress.org/support/users/creative-i/)
 * (@creative-i)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/iframe-code-deleted/#post-1935812)
 * Hi Billerickson:
    Ok, but what about for example when I use Vodpod? Vodpod sends
   the code automatically to my site, it’s not something I create.
 * Re modifying functions.php: Does it matter where it gets inserted?
 * Bill
 *  [Bill Erickson](https://wordpress.org/support/users/billerickson/)
 * (@billerickson)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/iframe-code-deleted/#post-1935825)
 * I’m not sure how Vodpod works, how does it automatically generate posts? As long
   as you (or Vodpod) don’t use the visual editor on a post that has code in it 
   you should be fine.
 * I’ve clicked on a few links in Vodpod and it looks like they’re hosting Youtube
   videos. If you could somehow have Youtube video URLs inserted rather than embed
   codes everything would work great. WordPress will automatically convert a youtube
   url into the embed code, so it won’t mess with your visual editor.
 *  [Bill Erickson](https://wordpress.org/support/users/billerickson/)
 * (@billerickson)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/iframe-code-deleted/#post-1935828)
 * It doesn’t really matter where your code goes in functions.php, but I’d suggest
   putting it at the very bottom, but before the ?> if that’s present in your file.
 *  Thread Starter [William Bowles](https://wordpress.org/support/users/creative-i/)
 * (@creative-i)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/iframe-code-deleted/#post-1935838)
 * Basically, what vodpod does is generate a link from whatever source I select,
   usually from the Bookmarklet I’ve installed in Firefox, so it pulls whatever 
   code is in the source, whether object or iframe and posts it to the WP editor.
   VP doesn’t host the video, just a link to it.
 * If it’s iframe I either paste in the object code (if I can get it) or I sometimes
   use a plugin eg [youtube]xxx…[/youtube] or whatever.
 * What I want to know is why does WP strip out the iframe code, especially as youtube
   and others seem to switching to iframe?
 * And I’ll check the functions.php
 * Thanks
 * Bill
 *  [Bill Erickson](https://wordpress.org/support/users/billerickson/)
 * (@billerickson)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/iframe-code-deleted/#post-1935865)
 * The visual editor isn’t meant for html code (like iframes), it’s meant for written
   content.
 * You don’t need to use a plugin for youtube shortcode ([youtube]xxx[/youtube]),
   that’s a built-in feature of WordPress. Go to General > Media and make sure auto-
   embed is checked. That will automatically convert [http://www.youtube.com/xxxx](http://www.youtube.com/xxxx)
   to the embed code.
 * More information here: [http://codex.wordpress.org/Embeds](http://codex.wordpress.org/Embeds)
 *  Thread Starter [William Bowles](https://wordpress.org/support/users/creative-i/)
 * (@creative-i)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/iframe-code-deleted/#post-1935885)
 * Yeah, I keep hearing this, but it’s such ass-backwards way of doing things. Surely
   I should be able to switch back and forth between visual and source, like I do
   in Dreamweaver for example or am I asking too much from the WP editor?
 * Re the youtube insert, ok if it’s youtube but I often post vids from other sources
   which is why I sometimes use a plugin or embed or object code.
 * And why does the Editor accept embed and object code but not iframe?
 * B
 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/iframe-code-deleted/#post-1935892)
 * [http://wordpress.org/extend/plugins/embed-iframe/](http://wordpress.org/extend/plugins/embed-iframe/)
 *  Thread Starter [William Bowles](https://wordpress.org/support/users/creative-i/)
 * (@creative-i)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/iframe-code-deleted/#post-1935916)
 * Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘iframe code deleted’ is closed to new replies.

## Tags

 * [iframe](https://wordpress.org/support/topic-tag/iframe/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 3 participants
 * Last reply from: [William Bowles](https://wordpress.org/support/users/creative-i/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/iframe-code-deleted/#post-1935916)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
