#下载wpcli
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
#Next, check the Phar file to verify that it’s working:
php wp-cli.phar --info
#To use WP-CLI from the command line by typing wp, make the file executable and move it to somewhere in your PATH. For example:
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
wp --info
#手动下载Wordpress,上传到/tmp/wordpress.zip
cd wordpress的安装目录下
wp cli update /tmp/wordpress.zip
#更新core之后,再更新db
wp core update-db

屏蔽异常关键字

下载WPKJ Block Search Words插件,参考倡萌作者的网页https://www.wpdaxue.com/wordpress-block-search-words.html

我们可以在网站根目录,创建一个robots.txt 文件,填入下面的内容:

User-agent: *
Disallow: /index.php
Disallow: /index.html
Disallow: /wp-admin/
Disallow: /*/feed
Disallow: /trackback/
Disallow: /*?replytocom=*
Disallow: /*/comment-page*
Disallow: /?s=*
Disallow: /author/

上面内容的倒数第2条规则,就是禁止收录搜索结果页。