Title: Embed Code disappears for some
Last modified: August 18, 2016

---

# Embed Code disappears for some

 *  [zapata](https://wordpress.org/support/users/zapata/)
 * (@zapata)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/embed-code-disappears-for-some/)
 * On my multi-author blog, some authors had been complaining that if they paste
   an embed code from YouTube in the post, it disappears upon saving the post.
 * Since I’ve never had this issue, I logged in as one of the authors (who has the
   problem) from the same computer I write my posts from. Sure enough, as soon as
   I pasted the YouTube code and saved the post, the embed tag disappeared.
 * I checked the author’s profile and the “Visual Text Editor” box, was unchecked–
   which I ask all my authors to do.
 * Any idea WordPress gurus, what could be going wrong here? We are on WP 2.1

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

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [19 years, 4 months ago](https://wordpress.org/support/topic/embed-code-disappears-for-some/#post-523071)
 * The embed tag is not valid XHTML (or indeed, valid HTML or anything else). The
   rich editor is probably stripping it out because of that.
 * Use semantically correct object tags instead.
 * If your authors don’t understand tags and how to convert and such, install a 
   YouTube plugin and let them use that to create links to YouTube instead. Don’t
   try using YouTube’s code, like most of those video sites, the code they generate
   is invalid and frankly untrustworthy.
 *  [eli03](https://wordpress.org/support/users/eli03/)
 * (@eli03)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/embed-code-disappears-for-some/#post-523072)
 * i also having a problem posting a code on my wordpress, disappears upon saving
   the post. Is there a plugin that can fix this problem ?
 * thanks,
    eli
 *  Thread Starter [zapata](https://wordpress.org/support/users/zapata/)
 * (@zapata)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/embed-code-disappears-for-some/#post-523074)
 * – Otta, the rich text editor (you mean the visual editor…right?) is switched 
   off…
    plus how does one explain the fact that if from the same computer when 
   I log in as myself I can easily paste the same code and save it without losing
   the code. But when I log in as the author who has had the problem, I paste the
   same code, but upon saving it gets lost… this seems to be a “profile” connected
   issue… (my guess)
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [19 years, 4 months ago](https://wordpress.org/support/topic/embed-code-disappears-for-some/#post-523147)
 * Ahhh. Okay. “Authors”, by default, get their HTML filtered. “Editors” and “Administrators”
   do not.
 * Install the Role Manager and see what roles your users have. If you want them
   to be able to insert HTML without getting filtered, give them the unfiltered_html
   capability using that.
 * A link to the Role Manager plugin can be found at the bottom of this page:
    [http://codex.wordpress.org/Roles_and_Capabilities](http://codex.wordpress.org/Roles_and_Capabilities)
 *  [tec-tec](https://wordpress.org/support/users/tec-tec/)
 * (@tec-tec)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/embed-code-disappears-for-some/#post-523167)
 * I am using admin mode and still my HTML embedding code gets filtered. Hell, even
   when I paste VALID XHTML code like this: `<object type="application/x-shockwave-
   flash" data="[INSERT VIDEO URL FROM EMBED CODE PROVIDED HERE]" width="400" height
   ="326"><param name="movie" value="[INSERT VIDEO URL FROM EMBED CODE PROVIDED 
   HERE]" /><param name="FlashVars" value="playerMode=embedded" /></object>`
    It
   gets broken by the visual editor as soon as I re-edit. I can’t wait to find a
   patch I can insert in the php to fix the WP code somehow – this is a serious 
   bug with the editor and a recurrent trouble with WP v2.1 published again and 
   again in this forum. Most video plugins are buggy and I just wish WP wouldnt 
   filter my HTML/XHTML code.
 *  [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * (@doodlebee)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/embed-code-disappears-for-some/#post-523173)
 * 1) turn off the “correct invalid XHTML” in your options area.
 * 2) the code gets wrapped in <p> tags. It’s easily fixed. Depends on what version
   of WordPress you’re using. For WP 2.0.x, you have to comment out the “wpautop”
   stuff in the default-filters.php file. In WP 2.1, you just edit a little bit 
   of your formatting.php file ([see this post](http://wordpress.org/support/topic/101906/page/2?replies=51)),
   this will keep the `<p>` tags from wrapping the lines of your embedded code.
 * Works like a charm 🙂
 *  [tec-tec](https://wordpress.org/support/users/tec-tec/)
 * (@tec-tec)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/embed-code-disappears-for-some/#post-523190)
 * sorry doodlebee, my “correct invalid XHTML” is off and still the code gets filtered.
   As I said it is a very serious bug that has been reported all over this forum
   and there should be a fix on the way – lets hope soon! For the the moment the
   best fix is one of the following:
 * 1) Go back to WordPress 2.0.x.
 * 2) Dump the visual editor.
 * 2) Make posts and save at once and not re-edit them or WordpRess 2.1 will break
   your HTML, even if it is valid XHTML.
 * I am sure the fix is on the way as such a basic feature cannot be so faulty as
   it is. I have read the fix ticket and I hope a patch shows up.
 *  Thread Starter [zapata](https://wordpress.org/support/users/zapata/)
 * (@zapata)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/embed-code-disappears-for-some/#post-523300)
 * Otto, I have the Role Manager installed and tried to check the unfiltered HTML
   option for ‘Authors’ when I got this error:
 * Fatal error: Cannot redeclare class rolemanager in /home/public_html/passionforcinema-
   com/wp-content/plugins/rolemanager/role-manager.php on line 22
 *  [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * (@doodlebee)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/embed-code-disappears-for-some/#post-523310)
 * tec – did you try the solution suggested in my previous post? I did it to my 
   own site, and it works perfectly.
 *  [The Daleks](https://wordpress.org/support/users/tunghoy/)
 * (@tunghoy)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/embed-code-disappears-for-some/#post-523608)
 * I can confirm the problem exists in version 2.3.1. In the Options area, there’s
   a checkbox for “WordPress should correct invalidly nested XHTML automatically”(
   there’s no other option for XHTML). Even with this option deselected, and editing
   a page when logged in as the Admin, WP breaks the Embed tags.
 *  [Steven](https://wordpress.org/support/users/shyzer/)
 * (@shyzer)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/embed-code-disappears-for-some/#post-523610)
 * I’d like to chime in and say this is a problem for WP 2.2 as well. I am an Administrator
   and have no trouble whatsoever embedding YouTube or Revver videos. However, all
   of my have their embed code wiped out when they save or publish their posts and
   I have to come behind them and add it in for them. It’s a bit of a pain!
 * I too have the XHTML option deselected and I’ve made sure they aren’t using the
   WYSIWYG editor. Still no dice.
 *  [Charles E. Frees-Melvin](https://wordpress.org/support/users/thee17/)
 * (@thee17)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/embed-code-disappears-for-some/#post-523611)
 * [http://trac.wordpress.org/ticket/3946](http://trac.wordpress.org/ticket/3946)
 * The filter that changes _ to <i> changes <embed> to <ibed>. Since embed was not
   a valid tag it was decided not to fix._

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

The topic ‘Embed Code disappears for some’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 12 replies
 * 8 participants
 * Last reply from: [Charles E. Frees-Melvin](https://wordpress.org/support/users/thee17/)
 * Last activity: [18 years, 5 months ago](https://wordpress.org/support/topic/embed-code-disappears-for-some/#post-523611)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
