Convert image by domain

Convert image by domain 1.6

No permission to buy ($35.00)
Compatible XF 2.x versions
  1. 2.0
  2. 2.1
  3. 2.2
Premium upgrade:

This XF2 add-on along with the entire collection can be purchased for $35.00 USD. Your Premium upgrade will allow you to download as many XF2 add-ons as you like for one year. Please see the entire collection located in the Resources area at this URL:


Converts hot linked images to attachments by selected domain.

The Convert image by domain add-on will convert hot linked images in messages to attachments. Hot linked images are those images that have been inserted using the Image icon in the editor toolbar.

(Example of IMG tag)


(Example of ATTACH tag)


(Example of Maximum attachment image dimensions selection)


(Example of Options page)


(Example of Convert image by domain page)


(Example of Rebuild now button)


  • Images greater than maximum width and height settings in Admin Control Panel will be resized.
  • Links surrounding attachments automatically removed.
Maximum attachment image dimensions selection:

Although the screenshot above says you can use 0 or blank, this add-on requires you to use a positive value for the Maximum attachment image dimensions settings. I suggest using 1600 x 1600.

Admin control panel -> Setup -> Options -> Attachments -> Maximum attachment image dimensions

How to use:
  1. Update the Options page with the domain you want to process.
  2. In your browser add 'convertimagebydomain' to your forum URL.
  3. Click the 'Prepare rebuild table' link.
  4. Go to the Tools menu in the Admin control panel and click 'Convert all images to attachments' link.
Question and Answers:

Q: I have an older forum with 1 million posts. How long will it take to convert all IMG tags to attachments?
A: Several hours is normal.

Q: Some hot linked image are not converted, why is this?
A: If a hot linked image is either too small or too large, or the dimensions are not able to be read, those images are not converted and will require manual conversion.

Q: Are attachments reused, meaning if the same attachment is located in several posts does each one use up disk space?
A: Each attachment is saved separately, however this is not a problem these days as disk space is so inexpensive.

Q: Does this add-on convert hot linked images in other areas besides posts?
A: No.

Q: Should I run this add-on once every few months to catch any new hot linked images not converted?
A: Yes.

Q: I want to convert photobucket images what should I do?
A: In the options page add the following:

Domain =
Referer =

Q: Can I run this add-on from CLI?
A: Yes. Navigate to the folder your forum runs in, then use the following command php cmd.php xf-rebuild:convertimagebydomain
  • Like
Reactions: vwts
First release
Last update
5.00 star(s) 2 ratings

More resources from AndyB

Latest updates

  1. See description

    Convert image by domain v1.6 changes: Improved PHP code relating to the search index.
  2. See description

    Convert image by domain v1.5 changes: Added Referer to options page. This allows converting low...
  3. See description

    Convert image by domain v1.4 changes: Code refactoring update.

Latest reviews

This is really useful. Back when we are using vbulletin, we used as the built in image upload is so clunky. We were able to migrate all those third party images to our new xenforo website. Also did the same for imgur and photobucket.
Great plugin that helped me a lot after migrate my forum.
This is really recommend, and if you understand how to code you can tweak it a little for your needs.