跳到内容

Static 404

v1.2.0

Brad Parbs · 2021年5月28日 上架

A WordPress plugin to quickly send a 404 for missing static files.

正在使用
3,000+
评分
暂无
累计下载
6,626
最近更新
2026年11月20日
需要 WordPress 6.0+已测试到 7.1.5PHP 7.4+

Quickly output a 404 for static files that aren’t found, rather than loading the normal 404 page.

Any static files ( images, text, pdfs, etc ) that don’t exist will 404 as soon as possible, rather than loading the entire WordPress application.

Available filters

By default, the list of extensions to check are the results of wp_get_ext_types, minus html, htm, php, and txt. This can be filtered with static_404_extensions.

The output is a static page with the text 404 Not Found, this text can be edited by filtering static_404_message.

A 404 status code will be used, but can be filtered with static_404_response_code.

Returning true from static_404_should_process_request will short-circuit and skip processing the request. This filter is passed false and the current request URI.

Only front-end requests routed through index.php are checked. Requests for wp-login.php, wp-cron.php, admin-ajax.php, and the admin are never affected.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums