在你的主题的functions.php文件中,或者通过创建一个插件来添加以下代码: add_filter( ‘login_registerurl’, ‘custom_register_url’); add_action(‘init’, ‘custom_reset_password_email’); function custom_reset_password_email() { add_action(‘retrieve_password_message’, ‘custom_retrieve_password_message’, 10, 4); } function custom_retrieve_password_message($message, $key, $user_login, $user_data) { $new_message = ‘ 有人请求重置您在 ‘ . wp_specialchars_decode(get_bloginfo(‘name’)) . ‘ 的密码。 如果您没有请求重置密码,请忽略此邮件。 要重置您的密码,请点击以下链接: 重置密码 ‘; return $new_message; }wp_email
Category: wordpress
wp后台地址安全指南
wordpress后台地址安全设置指南:防止未授权访问 默认的WordPress后台地址(域名/wp-admin 或 域名/wp-login.php)容易遭受攻击。 第一步:重命名并修改wp-login.php文件 找到WordPress目录下的wp-login.php文件,将其重命名为其他名称,例如:wp_admin.php。这样,您的后台登录地址将变为:
Search
在主题模板文件中添加搜索表单 如果你想要在特定的页面模板中添加搜索框,你可以 直接在主题的模板文件中添加HTML表单。 例如,在header.php或footer.php文件中添加以下代码: Search
wordpress-update
使用root进入mysql后台执行,xx.xxx.xxx.xx:800表示原地址,xx.xxx.xxx.xx表示新地址 mysql> UPDATE wp_options SET option_value = replace(option_value, ‘xx.xxx.xxx.xx:800′,’xx.xxx.xxx.xx’); Query OK, 3 rows affected (0.13 sec) Rows matched: 160 Changed: 3 Warnings: 0 mysql> UPDATE wp_posts SET post_content = replace(post_content, ‘xx.xxx.xxx.xx:800′,’xx.xxx.xxx.xx’); Query OK, 267 rows affected (0.13 sec) Rows matched: 457 Changed: 267 Warnings: 0 mysql> UPDATE wp_comments SET comment_content = replace(comment_content, ‘xx.xxx.xxx.xx:800′,’xx.xxx.xxx.xx’); Query OK,… Continue reading wordpress-update
如何在WordPress中上传多种安装包文件
打开WordPress后台,进入“外观”->“主题文件编辑器”。 在右侧选择functions.php文件进行编辑。 在functions.php文件末尾添加以下代码: 步骤一:这段代码将允许上传以下文件类型: function add_custom_mime_types($mimes) { // Windows $mimes[‘exe’] = ‘application/x-msdownload’; $mimes[‘msi’] = ‘application/x-msi’; // Linux $mimes[‘deb’] = ‘application/vnd.debian.binary-package’; $mimes[‘rpm’] = ‘application/x-rpm’; return $mimes; } add_filter(‘upload_mimes’, ‘add_custom_mime_types’); Linux:.deb 和 .rpm 步骤二:增加文件上传大小限制 由于安装包文件通常较大,我们需要确保WordPress的文件上传大小限制足够大。以下是几种方法来增加文件上传大小限制: 方法:修改php.ini文件 如果您有服务器的控制权限,可以修改php.ini文件: upload_max_filesize = 50M post_max_size = 50M 步骤三:上传安装包文件 完成上述步骤后,您可以开始在WordPress中上传安装包文件了