• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 How to create a new BBCode


Well-known member
I'm not a coder so I'm trying to understand how to do that. I've this code to embed a google map in a message
<iframe src="https://www.google.com/maps/d/u/0/embed?mid=zHVkoyIZEGOs.koLosDTtM_IE" width="100%" height="450"></iframe>
so how can I create a new BBCode to do that? There's someone willing to help me?



XenForo moderator
Staff member
You extract the portion of code which is different for each embed, presumably the zHVkoyIZEGOs.koLosDTtM_IE

You then replace that in the original code with {$id} and create a corresponding match URL.

Have a look how it's done for the bb code media sites.

I haven't looked into whether it's possible to do it with a basic bb code or not - it may require a PHP callback.

Mr Lucky

Well-known member
I don't know about PHP callback either, but you could first of all try this and see if it works

Match URL:
Embed html
<p><iframe src="https://www.google.com/maps/d/u/0/embed?mid={$id}" width="100%" height="450"></iframe></p>
So your custom BBcode will look a bit like this:
Screen Shot 2015-11-05 at 14.01.16.png
Last edited:


Well-known member
Just doing a test and i'm getting "The specified URL cannot be embedded as media". I am correct in just adding the ID of the location to the media embed?

EDIT: I've also tried the full URL given by Google Maps.

I have located the location ID via developers.google.com - ChIJVz2S8EKQe0gRy-Rzziio6k8
Last edited: