Support » Plugins and Hacks » WP Ajaxify Comments » [Resolved] Youtube Embed Code gets stripped off if page is not manually refreshed

[Resolved] Youtube Embed Code gets stripped off if page is not manually refreshed

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author janjonas



    thanks for your comment. Could you please provide more details about how you embed the YouTube video? Do you use any WordPress plugin or is the html embed code part of the comment?

    I am just using the iframe embed code from the youtube video. I am not using any plugin for displaying youtube videos.

    You can see it here in action. The first comment displays the video while the 2nd/3rd comments the embed code was stripped off and there is no video displayed. I used embed code of other videos – they are not all the same videos.

    I then manually refreshed the page and made a comment with the embed code along with the word “test” and it showed up fine. I then made a comment with another embed code and “test again” and only test again shows up and embed code is stripped off.


    Plugin Author janjonas


    as far as I know by default <iframe> tags are not allowed in comments. Have installed any other plugin that enables the <iframe> tags or is the “<iframe>-tag-support” part of your theme?

    I have a plugin User Role Editor using which I allow Unfiltered html for people with role of Authors.

    Plugin Author janjonas


    Thanks for your reply. I’ve tried the “User Role Editor” plugin and added the role “unfiltered_html” to my users but still no luck when posting <iframe> tags. Which WordPress version are you using?

    I was only able to post <iframe> tags when editing wp-includes\kses.php similar to the description here http://www.kavdesign.net/blog/coding/how-to-disable-wordpress-html-filter-for-posts-and-pages/.

    After commenting out the following lines:

    // Comment filtering
    if ( current_user_can( 'unfiltered_html' ) )
      add_filter( 'pre_comment_content', 'wp_filter_post_kses' );
      add_filter( 'pre_comment_content', 'wp_filter_kses' );

    posting <iframe> tags was possible but I did not find any conflicts with the WP-Ajaxify-Comments plugin. I think your problems are not caused by my plugin. Please make sure that the <iframe> tags inside the comments are really saved in the database and are returned to the theme when rendering the comment section.

    Hope this helps…

    I am using WordPress 3.5.1 and its a child theme of TwentyTen.

    I disabled WP-Ajaxify-Comments plugin and am able to post iframe code one after the other. There’s something with the refreshing of the whole page. If the whole page is refreshed then the embed shows up fine even when using your plugin.

    Thanks for that filter info.

    Plugin Author janjonas


    Hi, could you please send me login credentials for your page that enables me to post comments with <iframe>-tags? You can send me a private message here: http://blog.janjonas.net/contact


    Sent you a private message. Thanks.

    Plugin Author janjonas


    Mark this topic as resolved …

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] Youtube Embed Code gets stripped off if page is not manually refreshed’ is closed to new replies.
Skip to toolbar