跳到正文
工具

wp-config.php Generator

Build a correct wp-config.php without copy-pasting from a 2014 blog post

在你的浏览器里运行。什么都不上传。

Database
Debugging
Hardening
Limits
wp-config.php

Salts are generated in your browser with crypto.getRandomValues(). They are never sent anywhere — but for the record, WordPress's own api.wordpress.org salt endpoint is equally fine; it returns fresh random values over TLS.

关于wp-config.php Generator

Generate a wp-config.php with the constants you actually need — debug logging, memory limits, file-edit lockdown, upload limits, table prefix, and fresh salts. Everything is generated in your browser; nothing is sent anywhere.

FAQ

常见问题

在浏览器里生成 wp-config.php 的 salt 安全吗?

安全。这些 salt 是用 crypto.getRandomValues()(浏览器内置的密码学安全随机数生成器)生成的,永远不会离开你的机器。顺便说一句,WordPress 自家的 api.wordpress.org salt 接口同样安全——它通过 TLS 返回全新的随机值。这只是图个方便,并不是什么安全修复。

为什么它不问我的数据库密码?

因为你不该把生产环境的数据库密码输入到任何网页里,无论它声称自己多可信。生成的文件里有一个占位符——请在本地、在你的编辑器里填进去。

我能在一个已有的站点上更改表前缀吗?

光靠改 wp-config.php 是不行的。在正在运行的站点上更改 $table_prefix,需要重命名每一张表,并重写 options 和 usermeta 表里的两行数据。要改就在全新安装时改,否则就别动它。