WordPress.org

Ready to get started?Download WordPress

Forums

Embed Code disappears for some (13 posts)

  1. zapata
    Member
    Posted 7 years ago #

    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

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    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.

  3. eli03
    Member
    Posted 7 years ago #

    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

  4. zapata
    Member
    Posted 7 years ago #

    - 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)

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    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

  6. tec-tec
    Member
    Posted 7 years ago #

    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.

  7. Doodlebee
    Member
    Posted 7 years ago #

    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), this will keep the <p> tags from wrapping the lines of your embedded code.

    Works like a charm :)

  8. tec-tec
    Member
    Posted 7 years ago #

    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.

  9. zapata
    Member
    Posted 7 years ago #

    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

  10. Doodlebee
    Member
    Posted 7 years ago #

    tec - did you try the solution suggested in my previous post? I did it to my own site, and it works perfectly.

  11. tunghoy
    Member
    Posted 6 years ago #

    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.

  12. Shyzer
    Member
    Posted 6 years ago #

    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.

  13. Charles Frees-Melvin
    Member
    Posted 6 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic