没有不值得去解决的问题,也没有不值得去学习的技术!

CamelCase or Spaces for English Tags? My WordPress Bilingual Blog Tag Naming Conventions (v2.0)

作者:

在

As my blog contains more and more bilingual Chinese and English content, I recently started reorganizing the entire tag system.

Initially, I consistently used Camel Case.

For example:

Plaintext
AIGeneratedImages
ImageProcessing
TransparentBackground
BrowserCache
WordPressOptimization

The main reasons were that I felt it:

  • Looked relatively clean;
  • Matched the style of class and variable names in code;
  • Would result in fairly standard tag slugs.

It wasn’t until I recently organized the English tags that I noticed a problem.

WordPress auto-generated slugs are not ideal

For example, when adding a new tag:

Plaintext
AIGeneratedImages

WordPress automatically generates the slug:

Plaintext
aigeneratedimages

Instead of what I expected:

Plaintext
ai-generated-images

Similarly:

Plaintext
WordPressOptimization

Generates:

Plaintext
wordpressoptimization

Readability is clearly much worse.

Although I can manually modify the slug, I would have to do it every time I add a new tag in the future, which means high maintenance costs.

Then I thought of a simpler approach

Since WordPress itself already supports automatic slug generation.

Why not just use normal English for the tag names?

For example:

Plaintext
AI Generated Images

WordPress automatically generates:

Plaintext
ai-generated-images

Another example:

Plaintext
Image Processing

Automatically generates:

Plaintext
image-processing

This perfectly conforms to URL naming conventions.

Finally decided to use Title Case

Therefore, I decided to uniformly adopt the following for all English tags from now on:

Title Case (capitalize the first letter of each word, keep spaces in between)

For example:

ChineseEnglish
图像处理Image Processing
AI 绘图AI Generated Images
浏览器缓存Browser Cache
透明背景Transparent Background
网站设计Web Design
用户体验User Experience
WordPress 优化WordPress Optimization

This makes the reading experience in the backend more comfortable.

The slugs automatically generated by WordPress are also more natural.

For example:

Plaintext
Image Processing
↓

image-processing

Instead of:

Plaintext
ImageProcessing
↓

imageprocessing

Keep official names as they are

For official product names, just keep the official naming.

For example:

Plaintext
WordPress
ChatGPT Plus
Google AdSense
Google Analytics
Google Search Console
GitHub
Chrome
Firefox
Nginx

No longer changed to:

Plaintext
ChatGPTPlus
GoogleAnalytics

This also better matches the conventions used in official documentation and foreign websites.

Keep technical abbreviations as they are

Technical abbreviations continue to keep their official capitalization:

Plaintext
PHP
Go
AI
SEO
CSS
HTML
JSON
API
PNG
MySQL
Redis

Instead of:

Plaintext
Php
Json
Api
Png

Numeric versions follow official naming

For software with version numbers, likewise keep the official names:

For example:

Plaintext
Twenty Twenty-Five
Windows 11
Ubuntu 24.04
PHP 8.4
MySQL 8.0

However, for names that have already become common usage in the community, just keep them as they are.

For example:

Plaintext
Yii2
Vue3

Final conventions (v2.0)

After this adjustment, I decided to uniformly adopt the following conventions for the blog from now on.

Category

Use natural language naming.

For example:

Plaintext
WordPress
Linux
PHP
Go
AI 开发 & 工具

Series

Use the full series name.

For example:

Plaintext
WordPress 性能优化手记
博客商业模式探索
15 年后端开发的 AI 时代生存笔记

Tag

Chinese:

Use natural Chinese.

For example:

Plaintext
图像处理
浏览器缓存
透明背景

English:

Uniformly adopt:

Title Case (keep spaces)

For example:

Plaintext
Image Processing
Transparent Background
Browser Cache
WordPress Optimization
AI Generated Images

Slug

Leave it entirely to WordPress to generate automatically.

For example:

Plaintext
AI Generated Images
↓

ai-generated-images

No longer maintained manually.

In closing

Tags are just a very small part of a blog system.

But as the number of articles grows, a unified and standard naming convention can significantly reduce subsequent maintenance costs.

Especially for a bilingual Chinese and English blog, the earlier you establish unified conventions, the less hassle you’ll have later.

This adjustment may seem like simply changing English tags from Camel Case to spaced Title Case, but it actually means the entire blog content system has taken another step toward standardization.

系列导航

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系