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

Manually adding attachments and images via PHP script?


Active member
Hi All,

I am writing a PHP script to import my wordpress data. I can import all of the content fine but am having real issues importing my images with these posts.

I can get the attachment to a thread by inserting the correct data, however if I click on the image it comes up with a xenforo error.

Is there a way or simple class that I can use to attach images to posts from an external PHP script



XenForo moderator
Staff member
You would have to dig into the code and check how it's done when uploading an attachment to a post, then replicate that.

Mr. Goodie2Shoes

Well-known member
You should look into: