Title: OSS Aliyun
Author: 沈唁
Published: <strong>March 31, 2020</strong>
Last modified: December 5, 2025

---

Search plugins

![](https://ps.w.org/oss-aliyun/assets/banner-772x250.png?rev=2271217)

![](https://ps.w.org/oss-aliyun/assets/icon-128x128.png?rev=2271217)

# OSS Aliyun

 By [沈唁](https://profiles.wordpress.org/shenyanzhi/)

[Download](https://downloads.wordpress.org/plugin/oss-aliyun.1.5.1.zip)

[Live Preview](https://wordpress.org/plugins/oss-aliyun/?preview=1)

 * [Details](https://wordpress.org/plugins/oss-aliyun/#description)
 * [Reviews](https://wordpress.org/plugins/oss-aliyun/#reviews)
 *  [Installation](https://wordpress.org/plugins/oss-aliyun/#installation)
 * [Development](https://wordpress.org/plugins/oss-aliyun/#developers)

 [Support](https://wordpress.org/support/plugin/oss-aliyun/)

## Description

使用阿里云对象存储 OSS 作为附件存储空间。(This is a plugin that uses Aliyun Object
Storage Service for attachments remote saving.)

 * 依赖阿里云 OSS 服务：https://www.aliyun.com/product/oss

### 插件特点

 1.  可配置是否上传缩略图和是否保留本地备份
 2.  本地删除可同步删除阿里云对象存储 OSS 中的文件
 3.  支持阿里云对象存储 OSS 绑定的用户域名
 4.  支持替换数据库中旧的资源链接地址
 5.  支持阿里云对象存储 OSS 完整地域使用
 6.  支持同步历史附件到阿里云对象存储 OSS
 7.  支持阿里云 OSS 图片处理
 8.  支持上传文件自动重命名
 9.  支持使用 ECS 的 RAM 操作
 10. 支持原图保护
 11. 支持 `wp-cli` 命令上传/删除文件
 12. 支持多站点
 13. 支持图片裁剪编辑等操作后的上传
 14. 插件更多详细介绍和安装：[https://github.com/sy-records/aliyun-oss-wordpress](https://github.com/sy-records/aliyun-oss-wordpress)

### 其他插件

腾讯云 COS：[GitHub](https://github.com/sy-records/wordpress-qcloud-cos)，[WordPress Plugins](https://wordpress.org/plugins/sync-qcloud-cos)

华为云 OBS：[GitHub](https://github.com/sy-records/huaweicloud-obs-wordpress)，[WordPress Plugins](https://wordpress.org/plugins/obs-huaweicloud)
七牛云 KODO：[GitHub](https://github.com/sy-records/qiniu-kodo-wordpress)，[WordPress Plugins](https://wordpress.org/plugins/kodo-qiniu)
又拍云 USS：[GitHub](https://github.com/sy-records/upyun-uss-wordpress)，[WordPress Plugins](https://wordpress.org/plugins/uss-upyun)

### 作者博客

[沈唁志](https://qq52o.me)

欢迎加入沈唁的 WordPress 云存储全家桶 QQ 交流群：887595381

## Screenshots

 * [[
 * 设置页面
 * [[
 * 数据库同步
 * [[
 * 内置的 wp-cli 命令

## Installation

 1. Upload the folder `aliyun-oss-wordpress` or `oss-aliyun` to the `/wp-content/plugins/`
    directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. That’s all

## FAQ

### 怎么替换文章中之前的旧资源地址链接？

这个插件已经加上了替换数据库中之前的旧资源地址链接功能，只需要填好对应的链接即可

### 通过文件 URL 访问图片无法预览而是以附件形式下载？

因为 Bucket 是 2019 年 9 月 23 日后创建的，使用默认域名时会自动下载，需要绑定自有
域名访问。具体参考[阿里云文档](https://help.aliyun.com/document_detail/142631.html)。

### 如果存在第三方插件或者主题自带上传功能，内容上传到本地文件夹(即默认 wp-content/uploads)中，怎么上传到 OSS 中？

解决方案有两种，推荐使用第二种。

一是修改第三方插件或者主题的上传功能，调用插件的`oss_file_upload`方法（不推荐，一般人
不会修改）
 二是使用对象存储 OSS 提供的回源功能，配置为镜像方式。如果配置了镜像回
源，当用户对该存储空间内一个不存在的文件进行 GET 操作时，OSS 会向回源地址请求这个
文件，返回给用户，同时会将该文件存入 OSS。这样就达到了上传到 OSS 的需求。具体配置
参考阿里云文档[设置回源规则](https://help.aliyun.com/document_detail/31906.html)

## Reviews

![](https://secure.gravatar.com/avatar/096f652790fc163f2f44a1e4dea1b78267eb40f550838e9e39c2968973f1a066?
s=60&d=retro&r=g)

### 󠀁[主题缓存的css链接也替换成oss链接了 导致css无法加载](https://wordpress.org/support/topic/60-13/)󠁿

 [alextao](https://profiles.wordpress.org/alextao/) April 2, 2025

wordpress最新的几个版本之后，这些插件会把主题的缓存css链接也替换成oss链接，但是主题
的css文件插件又不会同步到oss，就会导致网站丢失css无法使用，希望修复。 主题css目录
参考： www.xxxxx.com/wp-content/uploads/wpcom/style.6.16.7.1741019906.css 包括 elementor
这类插件的缓存 CSS 也出现这个问题。

![](https://secure.gravatar.com/avatar/30e01f1dd51cdb4b4113fef174b774685b1a2b6820914881340eeab66b27902a?
s=60&d=retro&r=g)

### 󠀁[Excellent](https://wordpress.org/support/topic/excellent-13668/)󠁿

 [shadyduan](https://profiles.wordpress.org/shadyduan/) October 28, 2024 1 reply

The plugin hasn’t been used yet, but after checking the configuration interface,
it’s user-friendly and straightforward. As of October 2024, it had a recent update
just three months ago, showing dedication.

![](https://secure.gravatar.com/avatar/c03cff63f8ab6d196002038d0f61878cc2eea12ff19c2d4154cb1bc85019a4d1?
s=60&d=retro&r=g)

### 󠀁[挺您！！华人开源，群里回复售后支持，华人之光！！](https://wordpress.org/support/topic/%e6%8c%ba%e6%82%a8%ef%bc%81%ef%bc%81%e5%8d%8e%e4%ba%ba%e5%bc%80%e6%ba%90%ef%bc%8c%e7%be%a4%e9%87%8c%e5%9b%9e%e5%a4%8d%e5%94%ae%e5%90%8e%e6%94%af%e6%8c%81%ef%bc%8c%e5%8d%8e%e4%ba%ba%e4%b9%8b%e5%85%89/)󠁿

 [qiang184k](https://profiles.wordpress.org/qiang184k/) December 30, 2023 1 reply

非常棒棒

![](https://secure.gravatar.com/avatar/3b3273abeaf621739b5861e8a2fb0c4ac4e254403a3f9623c977ebc768f90cf0?
s=60&d=retro&r=g)

### 󠀁[好用，什么时候弄个multisites多站点支持](https://wordpress.org/support/topic/%e5%a5%bd%e7%94%a8%ef%bc%8c%e4%bb%80%e4%b9%88%e6%97%b6%e5%80%99%e5%bc%84%e4%b8%aamultisites%e5%a4%9a%e7%ab%99%e7%82%b9%e6%94%af%e6%8c%81/)󠁿

 [divivityan](https://profiles.wordpress.org/divivityan/) August 25, 2021

希望对多站点支持下

![](https://secure.gravatar.com/avatar/0a6b6083f655030acc8a0bc88bed03113bb67bd726e516ce490f94cb822335b0?
s=60&d=retro&r=g)

### 󠀁[很好用的插件，](https://wordpress.org/support/topic/%e5%be%88%e5%a5%bd%e7%94%a8%e7%9a%84%e6%8f%92%e4%bb%b6%ef%bc%8c/)󠁿

 [pipojie](https://profiles.wordpress.org/pipojie/) August 7, 2020

好用，没有广告，简单一看就明白，早点更新，大佬！

 [ Read all 5 reviews ](https://wordpress.org/support/plugin/oss-aliyun/reviews/)

## Contributors & Developers

“OSS Aliyun” is open source software. The following people have contributed to this
plugin.

Contributors

 *   [ 沈唁 ](https://profiles.wordpress.org/shenyanzhi/)

[Translate “OSS Aliyun” into your language.](https://translate.wordpress.org/projects/wp-plugins/oss-aliyun)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/oss-aliyun/), check
out the [SVN repository](https://plugins.svn.wordpress.org/oss-aliyun/), or subscribe
to the [development log](https://plugins.trac.wordpress.org/log/oss-aliyun/) by 
[RSS](https://plugins.trac.wordpress.org/log/oss-aliyun/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.5.1

 * Update nonce handling for form submissions

#### 1.5.0

 * Enhance region handling for OSS configuration

#### 1.4.21

 * Optimize uninstall code

#### 1.4.20

 * Fix origin_protect default value error

#### 1.4.19

 * Fix sub-site failure to delete remote images
 * Fix `get_option` default value error
 * Fix missing delete backup images

#### 1.4.18

 * Images processing ignore gif format

#### 1.4.17

 * Fix endpoint failed to use https

#### 1.4.16

 * 强制 endpoint 使用 https

#### 1.4.15

 * 将阿里云V1签名升级为V4签名

#### 1.4.14

 * 支持 `wp-cli` 命令删除文件
 * Use wp_get_mime_types instead of get_allowed_mime_types
 * 修复 heic 格式图片上传失败问题

#### 1.4.13

 * 支持 `wp-cli` 命令上传文件

#### 1.4.12

 * 支持原图保护

#### 1.4.11

 * 优化数据库数据替换语法

#### 1.4.10

 * 修复`不在本地保留备份`时获取不到非图片文件大小

#### 1.4.9

 * 升级 SDK
 * 增加 CSRF 验证

#### 1.4.8

 * 修复图片处理参数重复添加

#### 1.4.7

 * 修复 `upload_url_path` 设置为 `.` 时删除失败
 * 优化图片处理参数追加

#### 1.4.6

 * 修复 pdf 等文件格式上传时报错

#### 1.4.5

 * 兼容 PHP 7.0

#### 1.4.4

 * 修复超大文件原图上传和删除

#### 1.4.3

 * 修复同步错误
 * 更新地域

#### 1.4.2

 * 优化同步代码逻辑
 * 修复 webp 和 heic 格式图片上传缩略图失败问题

#### 1.4.1

 * 支持媒体库编辑图片上传

#### 1.4.0

 * 支持 WordPress 6.3 版本
 * 支持 RAM 操作 OSS

#### 1.3.2

 * 添加地域

#### 1.3.1

 * 优化代码

#### 1.3.0

 * 增加地域
 * 优化 isset 判断
 * 优化访问权限
 * 修复存在同名 path 时截取错误
 * 修改 accessKeySecret 类型为 password

#### 1.2.8

 * 支持上传文件自动重命名
 * 优化图片处理

#### 1.2.7

 * 增加地域

#### 1.2.6

 * 升级 oss sdk
 * 修复删除文件的 request id 异常
 * 支持 WordPress 5.8 版本

#### 1.2.5

 * 修复当文章图片重复时导致添加多个样式

#### 1.2.4

 * 添加 get_home_path 方法判断
 * 支持 WordPress 5.7 版本

#### 1.2.3

 * 支持删除非图片类型文件

#### 1.2.2

 * 支持 WordPress 5.6 版本
 * 升级 OSS SDK
 * 修复勾选不上传缩略图删除时不会删除已存在的缩略图

#### 1.2.1

 * 支持阿里云 OSS 图片处理

#### 1.2.0

 * 优化同步上传路径获取
 * 修复多站点上传原图失败，缩略图正常问题
 * 优化上传路径获取
 * 增加数据库题图链接替换

#### 1.1.1

 * 修复本地文件夹为根目录时路径错误
 * 减少一次获取配置代码…
 * 增加回源说明

#### 1.1.0

 * 优化删除文件使用删除多个接口
 * 修复勾选不在本地保存图片后媒体库显示默认图片问题

#### 1.0.1

 * 修复勾选不在本地保存图片后媒体库显示默认图片问题

#### 1.0

 * First version

## Meta

 *  Version **1.5.1**
 *  Last updated **4 months ago**
 *  Active installations **3,000+**
 *  WordPress version ** 4.6 or higher **
 *  Tested up to **6.9.4**
 *  PHP version ** 7.1 or higher **
 * Tags
 * [aliyun](https://wordpress.org/plugins/tags/aliyun/)[阿里云](https://wordpress.org/plugins/tags/%e9%98%bf%e9%87%8c%e4%ba%91/)
   [oss](https://wordpress.org/plugins/tags/oss/)[对象存储](https://wordpress.org/plugins/tags/%e5%af%b9%e8%b1%a1%e5%ad%98%e5%82%a8/)
 *  [Advanced View](https://wordpress.org/plugins/oss-aliyun/advanced/)

## Ratings

 4.8 out of 5 stars.

 *  [  4 5-star reviews     ](https://wordpress.org/support/plugin/oss-aliyun/reviews/?filter=5)
 *  [  1 4-star review     ](https://wordpress.org/support/plugin/oss-aliyun/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/oss-aliyun/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/oss-aliyun/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/oss-aliyun/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/oss-aliyun/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/oss-aliyun/reviews/)

## Contributors

 *   [ 沈唁 ](https://profiles.wordpress.org/shenyanzhi/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/oss-aliyun/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://qq52o.me/sponsor.html)