Embed Videos and Wordpress MU hack

**EDIT** Now there’s an easier way. You want THIS plugin, which will allow you to add embed, iframe and all sorts of goodies to your posts in Wordpress MU, even if you’re using feeds. If you want to know WHY this works, then continue reading below for the nuts -n- bolts. I’m still pretty proud I figured it out on my own! **END EDIT**

So you’re running a blog farm and you use third party software to manage it. You have one (or more) copies of Wordpress MU, and you’re trying to use Blogs Automater, or whatever your software of choice is, to post embedded videos.

And it isn’t working - all the code gets stripped out of your posts. It’s driving you nucking futs.

Well, after tearing my hair out this afternoon, I found the solution and I want to share it with you. It’s pretty simple BUT you’re going to have to modify a file in the wp-includes directory.

Ready? Here we go.
- Surf to your wp-includes directory
- open the file named “kses.php”
- Look for this line:
add_filter(’content_save_pre’, ‘wp_filter_post_kses’);
as of this writing it’s on line 1019, but it may move in the future when they upgrade the program.
- place TWO SLASHES in front of the line, so that it NOW looks like
// add_filter(’content_save_pre’, ‘wp_filter_post_kses’);
- Save the file (and reupload it if you downloaded it to work on). That’s it, you’re done!

DISCLAIMERS

If I were you, I would ONLY do this little trick on Wordpress MU installs that you do NOT allow other people access to. Not stripping code out of posts (which is what this hack does) means that you could put some very sneakeh bits of code in there. Just a word of warning.

WHY MODIFY THE CODE INSTEAD OF USING A PLUGIN?

Well, because most plugins require more formatting in your posts - adding some bits that say [tube] around the video or something. And that means you’d have to go through all your sponsor posts (I believe I have 35,000 right now) and modify them.
Sound like fun to you? Nah, me neither.

Hope this helps someone - leave a comment if it did!

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

thanks great help!

Leave a comment

(required)

(required)