Skip to content

fix(seo): shorten title tag suffix to prevent truncation in search results#2017

Merged
Yilialinn merged 1 commit intoapache:masterfrom
moonming:fix/title-tag-optimization
Apr 12, 2026
Merged

fix(seo): shorten title tag suffix to prevent truncation in search results#2017
Yilialinn merged 1 commit intoapache:masterfrom
moonming:fix/title-tag-optimization

Conversation

@moonming
Copy link
Copy Markdown
Member

@moonming moonming commented Apr 9, 2026

Summary

Shorten the site title from 57 characters to 13 characters so page titles are no longer truncated in Google search results.

Problem

The site title (siteConfig.title) was:

Apache APISIX® -- Cloud-Native API Gateway and AI Gateway

This 57-character string is appended to every page title via Docusaurus' default template: {pageTitle} | {siteTitle}. Since Google displays ~60 characters for title tags, virtually every page title was truncated:

Page Title tag (chars) Google shows
Getting Started 73 Getting Started | Apache APISIX® -- Cloud-Nat...
limit-count plugin 78 limit-count | Apache APISIX® -- Cloud-Native...
Blog post 80+ Free tier API with Apache APISIX | Apache API...

Truncated titles hurt click-through rates (CTR) because users cannot see the full page title or brand name.

Changes

File Change
website/docusaurus.config.js title -> 'Apache APISIX'
doc/docusaurus.config.js title -> 'Apache APISIX'
blog/en/docusaurus.config.js title -> 'Apache APISIX'
blog/zh/docusaurus.config.js title -> 'Apache APISIX'
website/src/pages/index.tsx Add explicit <title> to preserve full keyword-rich homepage title
website/src/pages/contribute.tsx Shorten hard-coded <title> suffix
website/src/pages/ai-gateway.tsx Update og:site_name to match

Result

Page Before After
Homepage Apache APISIX® -- Cloud-Native API Gateway and AI Gateway Apache APISIX® -- Cloud-Native API Gateway and AI Gateway (unchanged, explicit)
Getting Started Getting Started | Apache APISIX® -- Cloud-Nat... Getting Started | Apache APISIX (31 chars)
Blog post Free tier API with Apache APISIX | Apache API... Free tier API with Apache APISIX | Apache APISIX (49 chars)
AI Gateway APISIX AI Gateway - LLM Proxy... unchanged (has its own <title>)

The tagline, meta description, and navbar.title are all unchanged.

…sults

The site title was 'Apache APISIX® -- Cloud-Native API Gateway and AI
Gateway' (57 chars), which left almost no room for page-specific titles
within Google's ~60 character display limit. Every page title was being
truncated in search results, hurting CTR.

Before: 'Getting Started | Apache APISIX® -- Cloud-Native API Gateway...'
After:  'Getting Started | Apache APISIX'

Changes:
- Shorten siteConfig.title to 'Apache APISIX' in all 4 Docusaurus configs
  (website, doc, blog/en, blog/zh)
- Add explicit <title> to homepage (index.tsx) to preserve the full
  keyword-rich title for the homepage specifically
- Update contribute.tsx hard-coded <title> to use shorter suffix
- Update ai-gateway.tsx og:site_name to match

The tagline, meta description, and navbar title are unchanged.
Copilot AI review requested due to automatic review settings April 9, 2026 23:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Docusaurus site configuration and select page-level <Head> overrides to shorten the global siteConfig.title suffix (to reduce title-tag truncation in search results), while preserving a longer, keyword-rich homepage title where needed.

Changes:

  • Shorten title in multiple Docusaurus config files to Apache APISIX.
  • Add an explicit homepage <title> and adjust select page metadata (contribute, ai-gateway) to align with the new title strategy.
  • Update AI Gateway og:site_name to match the new shortened site title.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
website/src/pages/index.tsx Adds explicit homepage <title> via <Head> to preserve the long marketing title.
website/src/pages/contribute.tsx Shortens the contribute page <title> suffix.
website/src/pages/ai-gateway.tsx Updates og:site_name to the shortened site title.
website/docusaurus.config.js Shortens global Docusaurus title for the main website.
doc/docusaurus.config.js Shortens global Docusaurus title for the docs site.
blog/en/docusaurus.config.js Shortens global Docusaurus title for the EN blog site.
blog/zh/docusaurus.config.js Shortens global Docusaurus title for the ZH blog site.
Comments suppressed due to low confidence (1)

website/src/pages/index.tsx:53

  • <title> and twitter:title use different punctuation (-- vs -). This can lead to inconsistent titles between the page title and Twitter cards; align these strings (or generate both from a shared constant) to keep metadata consistent.
      <title>Apache APISIX® -- Cloud-Native API Gateway and AI Gateway</title>
      <meta
        name="twitter:title"
        content="Apache APISIX® - Cloud-Native API Gateway and AI Gateway"
      />

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Yilialinn Yilialinn merged commit 7e6f925 into apache:master Apr 12, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants