install WordPress
下载WordPress,解压至网站目录。以使用Nginx服务器为例,配置好站点之后,访问指定域名进入WordPress安装过程。
正常情况下首先会显示选择语言,如果显示:
Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.
则说明WordPress网站目录的权限未设置好。需要将WordPress网站目录所属用户组设定至Nginx指定的用户(由/etc/nginx/nginx.conf配置中的user www-data;指定):
chown -R www-data /web/wordpress
chgrp -R www-data /web/wordpress
如果未正确设置目录权限,会造成无法上传媒体文件,无法下载主题和插件。
Connection Information. To perform the requested action, WordPress needs to access to your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.
WordPress基本配置
安装后需要删除的文件
rm license.txt
rm readme.html
rm wp-admin/install.php
rm wp-config-sample.php
wp-config.php
WordPress安装之后,会自动创建wp-config.php文件,里面配置了数据库等信息。可以新增的一些实用配置:
//禁用历史修订版本
define('WP_POST_REVISIONS', false);
//自动保存时间设置为一天
define('AUTOSAVE_INTERVAL', 86400);
//自定义文件上传路径(相对于web根目录),不设置媒体文件默认会上传至wp-content/uploads。
define( 'UPLOADS', ''.'uploads');
wp-admin/options.php
wp-admin/options.php包含WordPress几乎所有设置选项字段,比如主题设置、插件设置等。
固定链接
推荐固定链接设置为:/%year%/%monthnum%/%postname%
去除wordpress版本信息
WordPress实用插件
WPS Hide Login
通过https://kanchuan.com/wp-admin可访问WordPress后台,安全起见,可隐藏处理。使用WPS Hide Login 插件,可以修改此路径。
Compress JPEG & PNG images
TinyPNG插件,支持图片压缩。
Yoast SEO
搜索引擎优化
Elementor
可视化拖拽编辑器
WP Fastest Cache
页面缓存
Post Views Counter
阅读量统计
留言板