Skip to main content

Enable "Last Updated" Docusaurus Dates on Vercel

· 5 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Docusaurus provides a powerful feature that displays the last updated time and last updated author for every blog post and documentation page.
However, when deploying a Docusaurus website on Vercel, many developers encounter the same confusing issue:

Every page shows the exact same “last updated” date — or no date at all.

This guide explains precisely why this happens and the exact configuration you must enable on Vercel to make Docusaurus timestamps work correctly.

Why Docusaurus Needs Full Git History

Docusaurus computes last update timestamps using your Git repository.
Internally, it runs a command equivalent to:

git log -1 --format=%at <path-to-file>

This means:

  • It does not use frontmatter metadata
  • It relies entirely on real Git commit timestamps
  • It must have access to the full commit history for each file

If commit history is missing, Docusaurus cannot determine when a file was last changed. Instead, every page ends up showing a generic or identical timestamp.

Why Vercel Breaks This by Default

Vercel performs a shallow clone of your Git repository:

  • It fetches only the latest commit
  • It discards all historical commits
  • It omits all timestamps needed by Docusaurus

A shallow clone is functionally equivalent to:

git clone --depth=1
What is a shallow clone?

A shallow clone contains only the most recent snapshot of your project.
It is faster, but it strips away commit history — and Docusaurus requires that history to calculate last updated times.

The Fix: Enable Deep Cloning on Vercel

Vercel offers a built-in environment variable that forces the platform to fetch the full Git history:

Variable NameValue
VERCEL_DEEP_CLONEboolean

How to Configure It

  1. Open your project in the Vercel Dashboard
  2. Go to: Settings → Environment Variables
  3. Add:
VERCEL_DEEP_CLONE = true
  1. Save changes
  2. Redeploy your project
After enabling deep clone

Docusaurus now has full access to your repository’s commit history, and last updated dates will display correctly.

Ensure Docusaurus Last Update Settings Are Enabled

In your docusaurus.config.js, confirm these settings:

docs: {
showLastUpdateTime: true,
showLastUpdateAuthor: true,
},
blog: {
showLastUpdateTime: true,
showLastUpdateAuthor: true,
},
pages: {
showLastUpdateTime: true,
showLastUpdateAuthor: true,
},

How to Verify That Everything Works

Once Vercel performs a deep clone, you can confirm timestamps are accurate in two ways.

1. Local Git check

git log -1 -- <path-to-file>

The timestamp shown locally should now match what appears on your website.

2. Vercel build logs

You should see evidence of a full Git clone rather than a shallow clone.

Why Last Update Date Matters for SEO and Transparency

Showing correct update timestamps is valuable for:

  • Google’s freshness ranking signals
  • Trustworthiness and transparency
  • Documentation maintenance
  • Open-source project credibility
  • Build-in-public workflows

Google may prioritize recently updated content, and readers appreciate authenticity in change history.

Summary

Enabling accurate “last updated” metadata in Docusaurus on Vercel requires:

  1. Full Git clone during the build
  2. Setting the environment variable: VERCEL_DEEP_CLONE=true
  3. Enabling last update settings in docusaurus.config.js

With these steps, Docusaurus can correctly read commit history and produce reliable update timestamps across all pages.

Sources