BB Code Media Sites

Post content can be enhanced by embedding video media from various sites. XenForo provides the ability to add other, compatible sites, in addition to those already configured.

Managing Media Sites

  1. Log in to the Admin Control Panel.
  2. Click on BB Code Media Sites from the list on the left hand side.

Various media sites are pre-configured in the software. They can be customised or deleted as required.

The Media Site ID is used in the BB Code tag when embedding the content, so for example, in the case of YouTube, it will appear in messages as follows:


This can be changed but be aware that any existing content using that tag will no longer work unless all of the corresponding BB Code tags in messages are updated.

Only sites which support a single token for the video identifier are supported and can be configured.

The Match URLs entries enable content to be embedded from various URLs. Each entry must include the {$id} token, which is used with the embed code to strip out the video ID.

Taking YouTube as an example again, any of the following URLs would work when embedding a video:

The result in all three cases will be embed code as previously mentioned:


The Embed HTML field is responsible for how any embedded media will actually appear in messages. This code is usually available from the respective site and can take several different forms, only one of which can be used with each BB Code Media Site entry.

The {$id} token in the Match URLs strings must be present here to enable the video content to be identified.

In most cases, the code can be edited to suit; for example the width and height values can be changed, along with the various other parameters. You will need to check the site in question to see what options there are.

The default YouTube entry uses the iframe code like so:

<iframe width="500" height="300" src="{$id}?wmode=opaque" frameborder="0" allowfullscreen></iframe>

You could however use the object version in its place:

<object width="500" height="300" data="{$id}&fs=1" type="application/x-shockwave-flash">
	<param name="movie" value="{$id}&fs=1" />
	<param name="allowFullScreen" value="true" />
	<param name="wmode" value="opaque" />
	<embed src="{$id}&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" wmode="opaque" width="500" height="300" />

Advanced Options

The advanced options tab makes it possible to configure sites which don't follow a simple video ID structure, or which don't include the necessary data in the URL.

The following video demonstrates some examples:

Some more examples can be seen in the Tips, Tricks and Guides forum.


In addition to the normal method of embedding via the editor toolbar, there is also the possibility of configuring auto-embedding.

  1. Log in to the Admin Control Panel.
  2. Click on the Options icon.
  3. Select the Messages group from the list.

If enabled, posting a URL from a configured site will result in it being automatically embedded.