Skip to content
Gaurav TiwariDocs

How to Put Dynamic Dates in Rank Math or Yoast SEO Titles

Updated October 19, 2026

The title readers click in Google comes from your SEO plugin, not from the post title. So a post can show 2026 on the page and still carry 2025 in its search snippet. Someone typed the year into the Rank Math or Yoast field by hand last January, and nobody changed it since.

The fix is to use the same date shortcode in the SEO fields. Type [year] or [monthyear] into the SEO title and description, and the meta tags follow the calendar the same way the page title does.

Dynamic Month & Year into Posts is my free plugin that renders date shortcodes across WordPress. It hooks into Rank Math, Yoast SEO and SEOPress directly, so the shortcodes work inside their fields with no extra setup.

Before You Start

Check these first:

  • Dynamic Month & Year into Posts 1.8.1 or newer is active.
  • Your SEO plugin is Rank Math, Yoast SEO or SEOPress. All in One SEO and other SEO plugins have no integration, so a shortcode in their fields stays as typed.
  • Settings → General → Timezone matches the market you write for.

Both Rank Math and Yoast have a current-year variable of their own: %currentyear% in Rank Math and %%currentyear%% in Yoast. Those work only inside the SEO plugin’s fields. The shortcode works in the post title, the content and the SEO fields alike, so one habit covers all of them.

What Each SEO Plugin Updates

The plugin filters each SEO plugin’s final output, so the shortcode renders wherever you put it in a field. Coverage differs by plugin:

OutputRank MathYoast SEOSEOPress
Meta titleYesYesYes
Meta descriptionYesYesYes
Open Graph title and descriptionYesYesNo
Twitter title and descriptionYesNoNo
Schema (JSON-LD)Every text valueWebPage name onlyNo
BreadcrumbsYesNoNo

Rank Math gets the widest coverage. The plugin walks through every text value in Rank Math’s JSON-LD, so an Article headline built from a title with [year] comes out as the actual year.

With Yoast, keep the shortcode out of the Twitter fields. Leave them empty or type a plain title there.

Add Dates in Rank Math

  1. Open the post and click the Rank Math icon in the editor toolbar.
  2. Click Edit Snippet.
  3. In Title, type the title with the shortcode, for example Best Laptops for Students in [year] %sep% %sitename%.
  4. In Description, use [monthyear] only if you refresh the post every month: Prices and picks checked in [monthyear].
  5. Open the Social tab if you set custom Facebook or Twitter titles, and use the same shortcode there.
  6. Update the post.
Rank Math snippet editor with the year shortcode in the title field

The snippet preview inside Rank Math shows [year] as typed. The rendered year appears on the front end, where the plugin’s filter runs.

Add Dates in Yoast SEO

  1. Open the post and the Yoast SEO panel in the editor sidebar.
  2. In SEO title, type Best Laptops for Students in [year], then any Yoast variables you normally use after it.
  3. In Meta description, add [monthyear] or [year] where the date belongs.
  4. In Social appearance, the Facebook title and description accept the shortcode. Leave the X (Twitter) fields without it.
  5. Update the post.

Add Dates in SEOPress

SEOPress covers the title and the meta description only. Put the shortcode in those 2 fields and keep social titles plain.

Check It Works

View the page source on the front end and search for these 3 things:

  • <title>, which should show the current year.
  • name="description", which should show the rendered month or year.
  • og:title, which should match for Rank Math and Yoast.

From a terminal, one line shows the title tag:

curl -s https://example.com/best-laptops-for-students/ | grep -o "<title>.*</title>"

For schema, paste the URL into Google’s Rich Results Test and read the headline and name values. A raw [year] there means that part of the schema isn’t covered by your SEO plugin’s integration.

When a Shortcode Leaks

Where you see [year]CauseFix
The SEO plugin’s snippet previewThe preview runs in the editor, before the front-end filterNothing to fix. Check the live page source instead
twitter:title on a Yoast siteYoast’s Twitter output isn’t filteredLeave the Twitter title empty or plain
Article headline in Yoast schemaOnly the WebPage name is filtered for YoastCheck it in the Rich Results Test; if it shows, keep the year in the visible title only
Every SEO field on an AIOSEO siteThere’s no AIOSEO integrationUse the SEO plugin’s own date variable instead
Last month in the descriptionA cached page or a cached SERP snippetPurge the page cache; Google refreshes its snippet on its next crawl

What It Won’t Do

The SEO integration has firm edges:

  • It doesn’t add variables to the SEO plugin. %currentyear% and %%currentyear%% belong to Rank Math and Yoast. This plugin adds shortcodes and renders them in the final output.
  • It doesn’t change dates in schema. datePublished and dateModified stay exactly as WordPress stores them.
  • It doesn’t make Google re-crawl. Your snippet in search results updates when Google next fetches the page.

A description that says “checked in October 2026” on a page nobody checked in October is fake freshness. Google’s own guidance warns about it. When Not to Use Dynamic Years covers that before it costs you trust. The SEO plugin integrations reference lists every hook the plugin uses.

Share

Was this helpful?

Still stuck? Open a support ticket