WPJAM插件的Rewrite规则优化是负优化,它移除了WordPress默认URL规则,导致大量链接返回404错误,严重影响Google搜索收录。因此需要恢复被移除的规则以解决SEO问题。
恢复Rewrite 规则优化的原因
原因一:
Rewrite 规则优化其实是负优化,导致了很多问题,尤其影响了GooGle Search Console 收录,需要让google 重新收录404的URL;
原因二:
同时也是为了BlogsClub 能更新我的文章
Rewrite 规则优化操作步骤和GooGle Search Console 收录影响具体原因
WPJAM插件某些优化并不是最优解,而且会有很多搜索引擎收录问题,从而影响SEO;
比如WPJAM插件Rewrite 规则优化:
- 移除日期 Rewrite 规则
- 移除留言 Rewrite 规则
- 移除分类 Feed Rewrite 规则
上面移除的规则会导致wordpress 默认的URL返回大量的404;
比如:
移除日期 Rewrite 规则,移除会导致https://www.saiita.com.cn/2025/10 返回404;
谷歌搜索引擎相关feed的URL 也会返回大量的404等等;
所以Rewrite 规则优化,其实是负优化,wordpress 存在的Rewrite 规则是有它的存在的原因,并不需要进行优化;
Rewrite 规则优化恢复
恢复的办法是再部署一个wordpress 网站,在新网站安装WPJAM插件插件,开启Rewrite 规则,通过AI对比Rewrite 规则列表里的正则表达式,整理出优化后的Rewrite 规则,然后再一个一个把优化掉的Rewrite 规则添加回去;
规则优化的相关Rewrite
分类目录 Feed
| 正则 | 查询 |
|---|
| lndex.php?category_name=$matches[1]&feed=$matches[2] | category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$ |
| lndex.php?category_name=$matches[1]&feed=$matches[2] | category/(.+?)/(feed|rdf|rss|rss2|atom)/?$ |
标签 Feed
| 正则 | 查询 |
|---|
| index.php?tag=$matches[1]&feed=$matches[2] | tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ |
| index.php?tag=$matches[1]&feed=$matches[2] | tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ |
文章格式 Feed
| 正则 | 查询 |
|---|
| index.php?post_format=$matches[1]&feed=$matches[2] | type/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ |
| index.php?post_format=$matches[1]&feed=$matches[2] | type/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ |
搜索 Feed
| 正则 | 查询 |
|---|
| index.php?s=$matches[1]&feed=$matches[2] | search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$ |
| index.php?s=$matches[1]&feed=$matches[2] | search/(.+)/(feed|rdf|rss|rss2|atom)/?$ |
作者 Feed
| 正则 | 查询 |
|---|
| index.php?author_name=$matches[1]&feed=$matches[2] | author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ |
| index.php?author_name=$matches[1]&feed=$matches[2] | author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ |
日期 Feed
| 正则 | 查询 |
|---|
| index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4] | ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ |
| index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4] | ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ |
| ndex.php?year=$matches[1]&feed=$matches[2] | ([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$ |
| ndex.php?year=$matches[1]&feed=$matches[2] | ([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$ |
评论 Feed
| 正则 | 查询 |
|---|
| index.php?&feed=$matches[1]&withcomments=1 | comments/feed/(feed|rdf|rss|rss2|atom)/?$ |
| index.php?&feed=$matches[1]&withcomments=1 | comments/(feed|rdf|rss|rss2|atom)/?$ |
全局 Feed
| 正则 | 查询 |
|---|
| index.php?&feed=$matches[1] | feed/(feed|rdf|rss|rss2|atom)/?$ |
| index.php?&feed=$matches[1] | (feed|rdf|rss|rss2|atom)/?$ |
附件 Feed
| 正则 | 查询 |
|---|
| index.php?attachment=$matches[1]&feed=$matches[2] | [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ |
| index.php?attachment=$matches[1]&feed=$matches[2] | [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ |
| |
页面 Feed
| 正则 | 查询 |
|---|
| index.php?pagename=$matches[1]&feed=$matches[2] | (.?.+?)/feed/(feed|rdf|rss|rss2|atom)/?$ |
| index.php?pagename=$matches[1]&feed=$matches[2] | (.?.+?)/(feed|rdf|rss|rss2|atom)/?$ |
完整日期路径 (年/月/日)
| 正则 | 查询 |
|---|
| index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4] | ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ |
| index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4] | ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ |
月份归档 (年/月)
| 正则 | 查询 |
|---|
| index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3] | ([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ |
| index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3] | ([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ |
日期路径分页
| 正则 | 查询 |
|---|
| index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4] | ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$ |
| index.php?year=$matches[1]&paged=$matches[2] | ([0-9]{4})/page/?([0-9]{1,})/?$ |
附件日期路径
| 正则 | 查询 |
|---|
| index.php?attachment=$matches[1] | [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/?$ |
| index.php?attachment=$matches[1]&tb=1 | [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/trackback/?$ |
| index.php?attachment=$matches[1]&feed=$matches[2] | [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ |
| index.php?attachment=$matches[1]&feed=$matches[2] | [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ |
评论分页路径
| 正则 | 查询 |
|---|
| index.php?attachment=$matches[1]&cpage=$matches[2] | [0-9]{4}/[0-9]{1,2}/[0-9]{1,2}/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$ |
| index.php?attachment=$matches[1]&cpage=$matches[2] | .?.+?/attachment/([^/]+)/comment-page-([0-9]{1,})/?$ |
页面评论路径
| 正则 | 查询 |
|---|
| index.php?pagename=$matches[1]&paged=$matches[2] | (.?.+?)/comment-page-([0-9]{1,})/?$ |
暂无评论
要发表评论,您必须先 登录