This topic describes how to store remote attachments from WordPress websites to OSS.
WordPress does not provide native support for this function, but you can use a third-party plug-in to implement this function. In this topic, the WordPress version is 4.3.1 and the plug-in is Hacklog Remote Attachment.
- Log on to the WordPress website with an administrator account.
- Click Plugin. Enter FTP in the Keyword search bar. Press Enter.
- Find Hacklog Remote Attachment. Click Install Now.
- After the plug-in is installed, choose .
- In the Hacklog Remote Attachment dialog box that appears, configure the FTP service information.
Configuration item Description FTP server Specifies the IP address that runs ossftp. We recommend that you set this parameter to 127.0.0.1. FTP server port number Specifies the port number of the FTP server. The default value is 2048. FTP account Specifies the FTP account in AccessKeyID/BucketName format. Note that the forward slash (/) is a delimiter and does not indicate an alternative. FTP password Specifies the FTP password AccessKey secret. FTP timeout Specifies the FTP timeout period. The default value is 30 seconds. Remote basic URL Specifies the public endpoint of the bucket. The format is http://BucketName.Endpoint. In this example, the bucket resides in the China (Hangzhou) region, and the bucket name is test-hz-jh-002. Therefore, the remote basic URL is http://test-hz-jh-002.oss-cn-hangzhou.aliyuncs.com/wp. For more information about endpoints, see OSS domain names. FTP remote path Specifies the path for storing the attachments in the bucket. In this example, wp indicates that all attachments are stored in the wp directory of the bucket. The Remote basic URL must correspond to the FTP remote path. HTTP remote path Specifies the HTTP remote path. We recommend that you set this parameter to a period (.).
- Click Save.
Clicking Save triggers a test on the configuration. The test result is shown at the top of the page.
- Post a new article to verify whether the configuration is successful.
- After you have written a new article, click Add Media to upload an attachment.
- Click Post. You can see the article that you have just written.
- Right-click the image and choose Open Link in New Tab from the shortcut menu.
The URL in the following figure indicates that the image has been uploaded to the OSS bucket test-hz-jh-002.