Inserting youtube video in forum’s post by URL. Youtube BBCode.

Published by Igor Khrupin on


Yesterday i needed BBCode which inserting video by URL, not by video ID. I don’t found this 🙂

Here i show you my BBCode.

BBCode usage:


HTML Replacement:

<script type="text/javascript">
    var s = '{URL}';
    var s2 = s.split("?v=")[1].split("&")[0];
    document.write('<iframe width="425" height="350" src="' + s2 +'?rel=0" frameborder="0" allowfullscreen></iframe>');


Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.