All shortcodes are localized via date_i18n() and output-escaped via esc_html().
Year Shortcodes
[year]— Current year → 2026[year n=5]— Current year + offset → 2031[year n=-10]— Current year – offset → 2016[nyear]— Next year → 2027[nnyear]— Year after next → 2028[pyear]— Previous year → 2025[ppyear]— Year before previous → 2024
Offset attribute: Thenattribute on[year]accepts any integer, positive or negative. Uses pure integer arithmetic (notstrtotime), so it handles large offsets correctly:
[year n=-2003] → 23
[year n=100] → 2126
Month Shortcodes
[month]— Full month name → February[cmonth]— Full month name (capitalized) → February[mon]— Short month name → Feb[cmon]— Short month name (capitalized) → Feb[mm]— Month number (zero-padded) → 02[mn]— Month number (no padding) → 2[nmonth]— Next month full name → March[cnmonth]— Next month capitalized → March[nmon]— Next month short → Mar[cnmon]— Next month short capitalized → Mar[pmonth]— Previous month full name → January[cpmonth]— Previous month capitalized → January[pmon]— Previous month short → Jan-
[cpmon]— Previous month short capitalized → Jan
Day Shortcodes
[dt]— Day of month → 18[nd]— Next day → 19[pd]— Previous day → 17[weekday]— Full weekday name → Tuesday-
[wd]— Short weekday name → Tue
Combined Date Shortcodes
[date]— Full date → February 18, 2026[monthyear]— Month and year → February 2026[nmonthyear]— Next month and year → March 2026-
[pmonthyear]— Previous month and year → January 2026
Post Date Shortcodes
[datepublished]— Post publication date (uses WordPress date format from Settings > General)[datemodified]— Post last modified date (uses WordPress date format from Settings > General)
These work inside post/page content. Outside the loop they return empty.
Season Shortcodes
[season]— Current season (Northern hemisphere)[season region="south"]— Current season (Southern hemisphere)
Northern hemisphere seasons:- Spring: March – May
- Summer: June – August
- Autumn: September – November
- Winter: December – February
Southern hemisphere seasons are reversed.
Event Shortcodes
[blackfriday]— Black Friday date (day after US Thanksgiving) → November 28[cybermonday]— Cyber Monday date (Monday after Thanksgiving) → December 1
Calculated dynamically based on the 4th Thursday of November each year.
Countdown & Age Shortcodes
-
[daysuntil date="YYYY-MM-DD"]—date(required) → Number of days until target date -
[dayssince date="YYYY-MM-DD"]—date(required) → Number of days since target date -
[age date="YYYY-MM-DD"]—date(required),format,ordinal/rank→ Age from birth date
Age format options: -
[age date="1990-05-15"]— 35 -
[age date="1990-05-15" format="ym"]— 35 years, 9 months -
[age date="1990-05-15" format="ymd"]— 35 years, 9 months, 3 days -
[age date="1990-05-15" ordinal="true"]— 35th -
[age date="1990-05-15" rank="true"]— 35th (alias for ordinal)
Quick Reference
Total shortcodes: 37
- Year — 7 →
[year],[nyear],[pyear],[nnyear],[ppyear] - Month — 14 →
[month],[mon],[mm],[mn],[nmonth],[pmonth] - Day — 5 →
[dt],[nd],[pd],[weekday],[wd] - Combined — 4 →
[date],[monthyear],[nmonthyear],[pmonthyear] - Post Date — 2 →
[datepublished],[datemodified] - Season — 1 (+attribute) →
[season],[season region="south"] - Events — 2 →
[blackfriday],[cybermonday] - Countdown/Age — 3 →
[daysuntil],[dayssince],[age]