主机信息
www.zhujixinxi.net

wordpress自动保存文章功能控制

WordPress拥有自动保存文章的功能,是为防止突然掉线或主机故障等丢失文章,默认情况下是 30 秒保存一次,保留最后的 5 个文章版本。如果你想修改这些默认设置,可以在WordPress根目录下的 wp-config.php 添加下方代码。

注意如果升级wordpress后会初始化,需重新添加。

找到 define( 'WP_DEBUG', false ); 行,并在其下方添加以下代码,保存后退出

// 禁用历史版本修订功能
define('WP_POST_REVISIONS', false);
// 设置自动保存时间为 24 小时
define('AUTOSAVE_INTERVAL', 86400);

以下为修改后的结果,部分内容省略

......
/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the documentation.
 *
 * @link https://wordpress.org/documentation/article/debugging-in-wordpress/
 */
define( 'WP_DEBUG', false );

/* Add any custom values between this line and the "stop editing" line. */

// 禁用历史版本修订功能
define('WP_POST_REVISIONS', false);
// 设置自动保存时间为 24 小时
define('AUTOSAVE_INTERVAL', 86400);

/* That's all, stop editing! Happy publishing. */
......
未经允许不得转载:主机信息 » wordpress自动保存文章功能控制
分享到

相关推荐

  • 暂无文章