All Products
Search
Document Center

Object Storage Service:How to store remote attachments from WordPress websites to OSS

Last Updated:Mar 20, 2026

Store media attachments uploaded to your WordPress site directly in an OSS bucket. This offloads media storage from your web server and serves uploaded files through the bucket's public endpoint.

This guide covers:

  1. Installing the Hacklog Remote Attachment plug-in

  2. Configuring FTP settings to point to your OSS bucket

  3. Verifying that new uploads are stored in OSS

Prerequisites

Before you begin, ensure that you have:

  • An OSS bucket with a public read access control list (ACL). See Activate OSS and Create buckets

  • A running WordPress installation

  • An AccessKey ID and AccessKey secret for your Alibaba Cloud account

How it works

WordPress does not natively support remote attachment storage. The Hacklog Remote Attachment plug-in bridges this gap by connecting WordPress to an OSS FTP service (ossftp) running on your server. When you upload media in WordPress, the plug-in sends the file to ossftp, which stores it in your bucket.

This guide uses WordPress 4.3.1 and the Hacklog Remote Attachment plug-in.

The remote attachment feature is also supported on Discuz! and PHPWind forums.

Install and configure the plug-in

Install the plug-in

  1. Log in to your WordPress admin dashboard using an administrator account.

  2. Click Plug-in in the sidebar.

  3. In the Keyword search bar, type FTP and press Enter.

  4. Find Hacklog Remote Attachment

  5. After installation, choose Settings > Hacklog Remote Attachment.

Configure FTP settings

In the Hacklog Remote Attachment Options dialog box, fill in the following fields:

ParameterDescriptionExample
FTP serverIP address of the server running ossftp. Set this to 127.0.0.1 if ossftp runs on the same server as WordPress.127.0.0.1
FTP server port numberPort that ossftp listens on. The default is 2048.2048
FTP accountYour credentials in AccessKeyID/BucketName format. The forward slash (/) is a delimiter, not an alternative symbol.LTAI5tXxx/my-bucket
FTP passwordYour AccessKey secret.
FTP timeoutConnection timeout in seconds. The default is 30.30
Remote basic URLPublic URL prefix for files stored in the bucket. The format is http://BucketName.Endpoint. To find your endpoint, see OSS domain names.http://test-hz-jh-002.oss-cn-hangzhou.aliyuncs.com/wp
FTP remote pathDirectory inside the bucket where attachments are stored. This value must match the path suffix in Remote basic URL.wp
HTTP remote pathSet this to a period (.)..

Constructing the remote basic URL

The URL combines your bucket name, the regional endpoint, and the FTP remote path:

http://<BucketName>.<Endpoint>/<FTPRemotePath>

To identify the parts from your bucket's details:

  • BucketName: the name of your OSS bucket (for example, test-hz-jh-002)

  • Endpoint: the endpoint for your bucket's region (for example, oss-cn-hangzhou.aliyuncs.com for China (Hangzhou))

  • FTPRemotePath: the directory name you choose for storing attachments (for example, wp)

The resulting URL for a bucket named test-hz-jh-002 in the China (Hangzhou) region with a remote path of wp is:

http://test-hz-jh-002.oss-cn-hangzhou.aliyuncs.com/wp

Replace oss-cn-hangzhou.aliyuncs.com with the endpoint for your region. For a full list of endpoints, see OSS domain names.

Save and test

Click Save

Verify the configuration

  1. Create a new post in WordPress.

  2. Click Add Media

  3. Click Post

  4. Right-click the image in the published post and choose Open Link in New Tab.

If the configuration is correct, the image URL uses your bucket's public endpoint, confirming that WordPress is storing new media attachments in OSS.

What's next

  • To serve media through your own domain name, bind a custom domain to your bucket. See Bind custom domain names.

  • To improve global access performance, configure Alibaba Cloud CDN to distribute your media from OSS edge nodes.