'YouTube embeds not working in WordPress after import from Blogger [closed]
I imported a series of blogger posts (via xml) into WordPress, and the YouTube embed tags were removed. YouTube URLs in posts are not identified. Instead, just the text of the url is left. Possibly as opposed to full embed tags. I'm trying to restore the embed codes so it's seen.
Another fact that is notable in the XML import is that [EMBLED CONTENT] appears instead of the url, that is, the video...
Solution 1:[1]
…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-includescalledkses.php. Inkses.php, you’ll want to scroll down to line 1309 and comment out the three lines under//Post filteringso 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
Solution 2:[2]
I think you have a couple of options here:
- 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?
- 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)
- if you have db access you could update the posts table to add the appropriate code back in.
- you could manually re-add the embed codes (obviously).
How many posts are we talking about?
Solution 3:[3]
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.
Solution 4:[4]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | LouieGeetoo |
| Solution 2 | cori |
| Solution 3 | Tim Cooper |
| Solution 4 | Andrew Barber |
