Files
SEONexus/docs/old-tmp-seo/42-老模板SEO代码优化实录-2026-04-19.md
Your Name e8688443e5 debug
2026-04-19 13:49:04 +08:00

257 lines
8.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 42-老模板 SEO 代码优化实录 - 2026-04-19
## 目的
这份文档不再讨论“应不应该改”,而是记录:
- `2026-04-19`
- 老模板 `1001-1005`
- 实际已经改了哪些 SEO 相关代码
- 这些改动分别在解决什么问题
这份文档适合主 Codex 直接接手时快速看现状。
---
## 一、今天已经落地的两轮代码优化
今天一共推进了两轮,范围都只在老模板 `1001-1005`
1. 第一轮:入口层与分类页 schema 收口
2. 第二轮:详情页/播放页分类链路纠偏
明确没有碰:
- `videoGpt1`
- GPT 模板相关文件
---
## 二、第一轮已落地内容
## 1. `sitemap_index.xml` 已从小说残留版改成视频站收口版
### 已改内容
5 套老模板的 `sitemap_index.xml` 都已经做了相同收口:
1. 删除小说时代遗留的:
- `sitemap-books-*.xml`
- `sitemap-books-catalog-*.xml`
- `sitemap-chapters-*.xml`
2. 删除 `novel:pagerexp ...` 相关残留
3. `loc``https://www.{$DomainModel->d_domain}` 改成:
- `https://{$DomainModel->d_domain}`
4. 当前只保留:
- `sitemap-main.xml`
### 已改文件
- [videoDadi sitemap_index.xml](/www/wwwroot/VideoSource2/code/app/home/view/videoDadi/sitemap/sitemap_index.xml:1)
- [videoDingZhu sitemap_index.xml](/www/wwwroot/VideoSource2/code/app/home/view/videoDingZhu/sitemap/sitemap_index.xml:1)
- [videoBoKu sitemap_index.xml](/www/wwwroot/VideoSource2/code/app/home/view/videoBoKu/sitemap/sitemap_index.xml:1)
- [videoLaoNiu sitemap_index.xml](/www/wwwroot/VideoSource2/code/app/home/view/videoLaoNiu/sitemap/sitemap_index.xml:1)
- [videoNuNu sitemap_index.xml](/www/wwwroot/VideoSource2/code/app/home/view/videoNuNu/sitemap/sitemap_index.xml:1)
### 对应目标
- 解决 `sitemap_requests = 0` 背后的入口信号不纯净问题
- 让 sitemap 重新像视频站入口,而不是小说遗留入口
---
## 2. 5 套首页都已补 canonical
### 已改内容
5 套首页都已补:
```html
<link rel="canonical" href="https://{$DomainModel->d_domain}" />
```
### 已改文件
- [videoDadi 首页](/www/wwwroot/VideoSource2/code/app/home/view/videoDadi/index/index.html:1)
- [videoDingZhu 首页](/www/wwwroot/VideoSource2/code/app/home/view/videoDingZhu/index/index.html:1)
- [videoBoKu 首页](/www/wwwroot/VideoSource2/code/app/home/view/videoBoKu/index/index.html:1)
- [videoLaoNiu 首页](/www/wwwroot/VideoSource2/code/app/home/view/videoLaoNiu/index/index.html:1)
- [videoNuNu 首页](/www/wwwroot/VideoSource2/code/app/home/view/videoNuNu/index/index.html:1)
### 对应目标
- 强化首页规范 URL 信号
- 减少首页层面对 `www / 裸域``http / https` 的纯跳转依赖
---
## 3. 首页 schema 已做第一轮“止血型”收口
### 已改内容
今天没有把首页 JSON-LD 做大改,而是先做最明显的止血动作:
1. 给首页 `WebSite` 节点补上 `@context`
2. 把非法类型:
- `Movies`
改成:
- `Movie`
3. 把非法动态类型:
- `ListItem{$Video.v_id}`
改成:
- `ListItem`
### 已改文件
- [videoDadi 首页](/www/wwwroot/VideoSource2/code/app/home/view/videoDadi/index/index.html:1)
- [videoDingZhu 首页](/www/wwwroot/VideoSource2/code/app/home/view/videoDingZhu/index/index.html:1)
- [videoBoKu 首页](/www/wwwroot/VideoSource2/code/app/home/view/videoBoKu/index/index.html:1)
- [videoLaoNiu 首页](/www/wwwroot/VideoSource2/code/app/home/view/videoLaoNiu/index/index.html:1)
- [videoNuNu 首页](/www/wwwroot/VideoSource2/code/app/home/view/videoNuNu/index/index.html:1)
### 当前判断
- 这不是首页 schema 的最终版
- 但已经先把最明显的不规范类型压下去了
---
## 4. 分类页 JSON-LD 已从高风险拼接改成更稳结构
### 已改内容
5 套 `getCategoryType.html` 里,原来最危险的一段是:
1. `potentialAction` 后缺逗号
2. 紧接 `hasPart`
3. 再拼一串 `VideoObject`
4. 很容易把整段 JSON-LD 拼坏
今天已经统一收口为更稳的结构:
1. 保留 `CollectionPage`
2. 保留 `BreadcrumbList`
3. 增加 `isPartOf -> WebSite`
4. 删除高风险的 `potentialAction + hasPart + VideoObject` 拼接
### 已改文件
- [videoDadi 分类页](/www/wwwroot/VideoSource2/code/app/home/view/videoDadi/video/getCategoryType.html:1)
- [videoDingZhu 分类页](/www/wwwroot/VideoSource2/code/app/home/view/videoDingZhu/video/getCategoryType.html:1)
- [videoBoKu 分类页](/www/wwwroot/VideoSource2/code/app/home/view/videoBoKu/video/getCategoryType.html:1)
- [videoLaoNiu 分类页](/www/wwwroot/VideoSource2/code/app/home/view/videoLaoNiu/video/getCategoryType.html:1)
- [videoNuNu 分类页](/www/wwwroot/VideoSource2/code/app/home/view/videoNuNu/video/getCategoryType.html:1)
### 对应目标
- 先把分类页 schema 从“可能无效”拉回“稳定可解析”
- 对应我们当前最缺的分类层抓取
---
## 三、第二轮已落地内容
## 5. 详情页/播放页里的分类链路已做统一纠偏
### 背景
今天继续排查时,发现老模板里至少还存在 3 种不一致的分类链路:
1. 有的页面把分类词送去搜索页:
- `site:vsurl key="$arrVideo.v_category"`
2. 有的页面把中文父分类名直接喂给:
- `site:vciurl parent_category="$arrVideo.v_parent_category"`
3. 有的页面父分类和子分类都没有落到规范分类页
这类问题不一定导致报错,但会直接削弱:
- `category_requests`
- 分类页规范抓取信号
### 已改原则
今天统一改成:
1. 父分类:
- `site:vciurl parent_category="$arrVideo.v_parent_category_en"`
2. 子分类:
- `site:vclurl parent_category="$arrVideo.v_parent_category_en" category="$arrVideo.v_category_en" ...`
### 已改文件
- [videoNuNu 详情页](/www/wwwroot/VideoSource2/code/app/home/view/videoNuNu/video/getVideoInfo.html:200)
- [videoNuNu 播放页](/www/wwwroot/VideoSource2/code/app/home/view/videoNuNu/video/getVideoPlayUrl.html:270)
- [videoLaoNiu 详情页](/www/wwwroot/VideoSource2/code/app/home/view/videoLaoNiu/video/getVideoInfo.html:220)
- [videoLaoNiu 播放页](/www/wwwroot/VideoSource2/code/app/home/view/videoLaoNiu/video/getVideoPlayUrl.html:210)
- [videoBoKu 详情页](/www/wwwroot/VideoSource2/code/app/home/view/videoBoKu/video/getVideoInfo.html:210)
- [videoDingZhu 详情页](/www/wwwroot/VideoSource2/code/app/home/view/videoDingZhu/video/getVideoInfo.html:215)
- [videoDadi 详情页](/www/wwwroot/VideoSource2/code/app/home/view/videoDadi/video/getVideoInfo.html:180)
- [videoDadi 播放页](/www/wwwroot/VideoSource2/code/app/home/view/videoDadi/video/getVideoPlayUrl.html:205)
### 这轮的价值
这轮比改 schema 更贴近蜘蛛真实行为,因为这些位置属于:
1. 详情页信息区
2. 播放页信息区
3. 剧情介绍区
它们都可能被蜘蛛继续吃到,并作为后续抓取入口。
---
## 四、今天改完后的当前状态
截至 `2026-04-19` 当前会话,已经确认:
1. `sitemap_index.xml` 的小说残留入口已清掉
2. 首页 canonical 已补齐
3. 首页 schema 的明显非法类型已收口
4. 分类页 JSON-LD 最危险的非法拼接已去掉
5. 详情页/播放页里最明显的错误分类链路已纠正
另外,今天额外用 `rg` 复扫后,之前那几个最明显的问题模式已经没有继续扫出来:
1. 分类词走 `site:vsurl key="$arrVideo.v_category"`
2. 父分类中文名直接塞进 `site:vciurl parent_category="$arrVideo.v_parent_category"`
说明第二轮纠偏已经基本覆盖到当前最明显的问题点。
---
## 五、今天还没做的事
今天还没有继续做下面这些动作:
1. 首页 JSON-LD 做完全重构
2. 详情页/播放页正文外其他区块的深度链接复核
3. `getCategory.html` 这一类分类列表页的二次收口
4. 运行态联调和线上日志二次验证
所以今天的结论不是“SEO 代码已经全部完成”,而是:
- 最值得先动的入口层、分类层、分类链路问题已经先压下去了
---
## 六、下一步最该看什么
下一轮不要盲改,而是先用蜘蛛日志验证这两条:
1. `category_requests` 是否从 `0` 抬起
2. `301` 是否继续下降
如果这两条有改善,说明今天这两轮代码优化已经打到点上。
如果没有改善,再继续看:
1. 首页模块内部链接是否还需要继续增强
2. 分类列表页 `getCategory.html` 是否还存在链路噪音
3. 入口层 `robots / sitemap / home` 是否还有边缘层干扰
---
## 七、一句话交接
> `2026-04-19` 这一天,老模板 `1001-1005` 已经完成两轮实质性 SEO 代码收口:先清入口层和分类页 schema再修详情页/播放页的错误分类链路;下一步不要再凭感觉改,而是等下一轮蜘蛛日志验证分类层是否真正起量。