Title: BEA &#8211; Sanitize Filename
Author: BE API
Published: <strong>2018 年 2 月 3 日</strong>
Last modified: 2026 年 4 月 7 日

---

搜索插件

![](https://ps.w.org/bea-sanitize-filename/assets/banner-772x250.png?rev=1814820)

![](https://ps.w.org/bea-sanitize-filename/assets/icon-256x256.png?rev=1814820)

# BEA – Sanitize Filename

 作者：[BE API](https://profiles.wordpress.org/beapi/)

[下载](https://downloads.wordpress.org/plugin/bea-sanitize-filename.2.0.10.zip)

 * [详情](https://cn.wordpress.org/plugins/bea-sanitize-filename/#description)
 * [评价](https://cn.wordpress.org/plugins/bea-sanitize-filename/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/bea-sanitize-filename/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/bea-sanitize-filename/#developers)

 [支持](https://wordpress.org/support/plugin/bea-sanitize-filename/)

## 描述

This plugin allows you to sanitize files on upload, which is pretty handy. It means
all punctuation and accents from the filename of uploaded files will be removed.

### Features

 * All accented letters will be converted to same letters without accent
 * Special characters will be deleted
 * Underscores will be replaced by hyphens

### Warning For Mac Owners

On MAC, you can also create an accented character with the combination of ` and 
the wanted letter. This has the effect to create a character with a special filename
system encoding format which is not sanitized. An [issue](https://github.com/BeAPI/bea-sanitize-filename/issues/1)
is already open about this.

### Who ?

Created by [Be API](https://beapi.fr), the French WordPress leader agency since 
2009. Based in Paris, we are more than 30 people and always [hiring](https://beapi.workable.com)
some fun and talented guys. So we will be pleased to work with you.

This plugin is only maintained, which means we do not guarantee some free support.
Consider reporting an [issue](https://github.com/BeAPI/bea-sanitize-filename/issues)
and be patient.

To facilitate the process of submitting an issue and quicker answer, we only use
Github, so don’t use WP.Org support, it will not be considered.

## 安装

#### Requirements

#### WordPress

 * Download and install using the built-in WordPress plugin installer.
 * Site activate in the “Plugins” area of the admin.
 * Nothing more, this plugin is ready to use !

## 常见问题

### Will this plugin affect existing files ?

No.

Only after plugin activation, while a file is uploaded to the library. However, 
inf the future a tool will be available to sanitize old files.

### Can I use into a multisite ?

Yes.

You just need to activate on each site.

## 评价

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

### 󠀁[Works Fine](https://wordpress.org/support/topic/works-fine-981/)󠁿

 [Olivier GBLEM](https://profiles.wordpress.org/keographix/) 2019 年 2 月 17 日

A very good plugin. Thanks

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

### 󠀁[Tip top !](https://wordpress.org/support/topic/tip-top-4/)󠁿

 [GregRuelle](https://profiles.wordpress.org/selfemedia/) 2018 年 2 月 7 日 1 回复

Il est intégré à tous mes projets depuis plusieurs mois, content qu'il soit maintenant
sur le repo officiel !

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

### 󠀁[essential](https://wordpress.org/support/topic/essential-190/)󠁿

 [madvic](https://profiles.wordpress.org/madvic/) 2018 年 2 月 7 日 1 回复

This script is missing from the core

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

### 󠀁[An absolutely must have](https://wordpress.org/support/topic/an-absolutely-must-have/)󠁿

 [Cyrille Sanson](https://profiles.wordpress.org/css31/) 2018 年 2 月 6 日 1 回复

Hi, This plugin is an absolutely must have. It will correct at the upload each file
name that are not respecting good practices. I don't understand why it's not a part
of WordPress. Good job guys!

 [ 阅读所有4条评价 ](https://wordpress.org/support/plugin/bea-sanitize-filename/reviews/)

## 贡献者及开发者

「BEA – Sanitize Filename」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ BE API ](https://profiles.wordpress.org/beapi/)
 *   [ Maxime Culea ](https://profiles.wordpress.org/maximeculea/)
 *   [ Amaury Balmer ](https://profiles.wordpress.org/momo360modena/)

[帮助将「BEA – Sanitize Filename」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/bea-sanitize-filename)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/bea-sanitize-filename/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/bea-sanitize-filename/)，或通过[RSS](https://plugins.trac.wordpress.org/log/bea-sanitize-filename/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/bea-sanitize-filename/)。

## 更新日志

#### 2.0.10 – 07 Apr 2026

 * Improve `sanitize_file_name` handling so only the real file suffix is transformed(
   avoid stripping when an extension-like segment appears earlier in the name)
 * Expand PHPUnit coverage with data providers and upload-style filename cases
 * Tidy `sanitize_file_name_chars` flow and align PHPCS with PHP 8.0; refine Composer/
   npm test scripts

#### 2.0.9 – 02 Apr 2026

 * Fix invalid smart quotes in special characters list
 * Migrate tests to `wp-env` with PHPUnit unit tests only
 * Improve testing documentation and scripts

#### 2.0.8 – 02 Apr 2026

 * Add `@` character to the sanitized characters list

#### 2.0.7 – 20 Sept 2022

 * Non Latin characters in filename are handled

#### 2.0.6 – 05 Oct 2018

 * #8 : Add More accentuated characters

#### 2.0.5 – 12 Feb 2018

 * i18n

#### 2.0.0 – 02 Feb 2018

 * Go to WP

#### 1.0.4 – 19 Dec 2017

 * Branding refactor

#### 1.0.3 – 19 Dec 2017

 * Fix some PHP notices

#### 1.0.2 – 08 Sept 2017

 * Update `sanitize_file_name_chars` list

#### 1.0.1 – 05 Aug 2017

 * Add readme
 * Replace underscore by hyphen
 * Only lowercase

#### 1.0.0 – 27 Nov 2015

 * Initial

## 额外信息

 *  版本 **2.0.10**
 *  最后更新：**7 月前**
 *  活跃安装数量 **1,000+**
 *  WordPress 版本 ** 4.0 或更高版本 **
 *  已测试的最高版本为 **7.0.8**
 *  PHP 版本 ** 8.0 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/bea-sanitize-filename/)
 * 标签
 * [media](https://cn.wordpress.org/plugins/tags/media/)[sanitize](https://cn.wordpress.org/plugins/tags/sanitize/)
   [uploads](https://cn.wordpress.org/plugins/tags/uploads/)
 *  [高级视图](https://cn.wordpress.org/plugins/bea-sanitize-filename/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  4 条 5 星评价     ](https://wordpress.org/support/plugin/bea-sanitize-filename/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/bea-sanitize-filename/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/bea-sanitize-filename/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/bea-sanitize-filename/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/bea-sanitize-filename/reviews/?filter=1)

[您的评价](https://wordpress.org/support/plugin/bea-sanitize-filename/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/bea-sanitize-filename/reviews/)

## 贡献者

 *   [ BE API ](https://profiles.wordpress.org/beapi/)
 *   [ Maxime Culea ](https://profiles.wordpress.org/maximeculea/)
 *   [ Amaury Balmer ](https://profiles.wordpress.org/momo360modena/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/bea-sanitize-filename/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://paypal.me/BeAPI)