Question

I imported a series of blog posts from blogger to WordPress, and the YouTube embed tags were stripped away. Now I just have the YouTube URLs in the posts, as opposed to the complete embed tags. I am trying to restore the embed codes.

Was it helpful?

Solution

This all really depends on HOW you imported the blog posts. What was your method?

When you view the raw source of the posts in wordpress (plain text view) - what does the post look like (a copy of the HTML would be nice)

-- Note - edit your original post to give the answers, a reply doesn't really work if other people answer too.

OTHER TIPS

…by default, WordPress filters imported XML by removing possible troublesome tags…unfortunateely, including things like <embed> and <iframe> and other instances where you’ve included content in your posts. WordPress does so via a file you can find in /wp-includes called kses.php. In kses.php, you’ll want to scroll down to line 1309 and comment out the three lines under //Post filtering so that they look like this:

// Post filtering
#add_filter('content_save_pre', 'wp_filter_post_kses');
#add_filter('excerpt_save_pre', 'wp_filter_post_kses');
#add_filter('content_filtered_save_pre', 'wp_filter_post_kses');

Source: http://jasongriffey.net/wp/2010/06/21/moving-to-wordpress-3-0/ and http://wordpress.org/support/topic/youtube-embeds-not-working-after-import

I think you have a couple of options here:

  1. You could undo the import and re-import using another means, from RSS for instance. The value of this depends on how much effort you have in the posts as they are in WordPress now - are you willing to dump the posts and try again?
  2. You go to the forums, post a bug in trac, go to the IRC channel and try to find some more information; you're apparently not the only person to have this problem (unless, of course, that's you)
  3. if you have db access you could update the posts table to add the appropriate code back in.
  4. you could manually re-add the embed codes (obviously).

How many posts are we talking about?

When I moved from blogger to wordpress my YouTube videos moved over just fine. Martin is right, a view of the post source code is probably required to be helpful.

One thing to note on a side issue though. When you use the wordpress "blogger importer" the image links will not be updated. When you view your blog everything will look ok, but in fact the images will still be referencing the blogger site.

There is a plugin on wordpress.org that will help with this, but some manual updating may / will be required for a 100% perfect move.

I think this is the one I used.

http://wordpress.org/extend/plugins/blogger-image-import/

Here's the solution I found on a wordpress forums.

Find in /wp-includes a file called kses.php. In kses.php, you’ll want to scroll down to line 1309 and comment out the three lines under //Post filtering so that they look like this:

// Post filtering
#add_filter('content_save_pre', 'wp_filter_post_kses');
#add_filter('excerpt_save_pre', 'wp_filter_post_kses');
#add_filter('content_filtered_save_pre', 'wp_filter_post_kses');

This will prevent the filter from removing all your YouTube videos, SlideShare embed, Scribd documents, etc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top