length
它能做什么
这个技能检查网站上的网页地址,并建议更短、更干净的版本。它面向创建网址片段的网站所有者和写作者。
适用场景
- ✓你的页面地址很长,充满了填充词的时候。
- ✓网页地址包含许多嵌套文件夹或日期的时候。
- ✓你从文章标题生成网址片段的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/length/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我缩短博客的页面地址吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查每个路径的长度、停用词、嵌套深度,以及常青内容中的日期。它会建议保留关键词的更短网址片段。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Keep URLs concise
While Google has no strict URL length limit beyond technical constraints, long URLs with deep nesting, excessive parameters, or redundant words are harder for users to read, copy, and share. Google's John Mueller has confirmed that shorter, cleaner URLs are easier to understand and may perform slightly better in search.
Quick Reference
- Keep URL paths under 100 characters; Google recommends short, descriptive URLs without unnecessary parameters
- Remove stop words (
the,a,of,in) from slugs —/guide-css-gridis better than/a-guide-to-css-grid - Deeply nested paths (
/blog/2024/03/category/subcategory/post-title) are harder to share and signal distance from the root
Check
For each page URL, extract the path component (excluding domain and query string). Flag: (1) Path length over 100 characters. (2) More than 4 path segments (e.g., /a/b/c/d/e has 5 segments). (3) Common stop words in slugs (the, a, an, of, in, at, to, for, with). (4) Dates in URL paths for evergreen content (e.g., /blog/2024/03/css-guide). (5) Session IDs, tracking parameters, or other dynamic values in paths.
Fix
- Shorten slugs by removing stop words:
/how-to-optimise-your-websites-core-web-vitals→/optimise-core-web-vitals/a-comprehensive-guide-to-css-grid-layout→/css-grid-guide
- Flatten URL structure where category hierarchy is not essential:
/blog/2024/march/technology/css-grid→/blog/css-grid
- Remove dates from evergreen content URLs (with 301 redirects from old URLs).
- Remove session IDs and tracking parameters from URLs used as canonical-url URLs.
- Implement changes with 301 redirects from old to new URLs to preserve link equity.
- Update sitemaps and internal links after URL changes.
Explain
Google recommends keeping URLs 'simple, descriptive, and readable'. Long URLs are more prone to being truncated in search snippets, harder to share, and more confusing to users. Deep URL structures (many subdirectories) do not directly harm rankings, but they can increase crawl distance from the root, reducing crawl frequency for deep pages on large sites.
Code Review
Parse the pathname of each URL. Count path segments (split by /). Measure character length of the path. Flag slugs containing common stop words. Report the longest 10 URLs by character count and deepest 10 by segment count. Check whether URL generation utilities strip stop words and limit segment depth.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
常见问题
网址长度有严格限制吗?
这个技能说没有严格限制,但建议把路径保持在约 100 个字符以内。
网址片段中应该去掉哪些词?
这个技能建议去掉 the、a、of、in 等停用词。
网址中应该包含日期吗?
这个技能说,路径中的日期对常青内容是个问题,建议避免。
详情
作者的原始描述
Use when generating URL slugs from article titles, auditing URL structures for unnecessary depth or length, or reviewing URL patterns in a CMS or router configuration.
热度
- GitHub 星标
- 75k
- 排名
- #2919
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。