Automate SEO and content with dynamic shortcodes for dates, years, months, age calculations, and countdowns in content, titles, and meta descriptions.
Contributors: gauravtiwari Donate link: https://gauravtiwari.org/donate/ Tags: dynamic content, shortcode, seo, dates, year Requires at least: 6.5 Tested up to: 7.1 Stable tag: 1.8.1 License: GPL-3.0 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html
Insert dynamic dates, months, years, age calculations, and countdowns anywhere in your WordPress content. Perfect for affiliate marketers, bloggers, and content creators who want their content to stay fresh and up-to-date automatically.
Use shortcodes like [year], [month], [date], [age], [daysuntil] and more in your posts, pages, titles, and SEO meta to keep your content always current without manual updates.
| Shortcode | Output | Description |
|---|---|---|
[year] |
2026 | Current year |
[year n=5] |
2031 | Year with offset (+5 years) |
[year n=-3] |
2023 | Year with offset (-3 years) |
[nyear] |
2027 | Next year |
[nnyear] |
2028 | Year after next |
[pyear] |
2025 | Previous year |
[ppyear] |
2024 | Year before previous |
| Shortcode | Output | Description |
|---|---|---|
[month] |
January | Current month (full name) |
[cmonth] |
January | Current month (capitalized) |
[mon] |
Jan | Current month (short name) |
[cmon] |
Jan | Current month (short, capitalized) |
[mm] |
01 | Month number with zero (01-12) |
[mn] |
1 | Month number without zero (1-12) |
[nmonth] |
February | Next month (full name) |
[cnmonth] |
February | Next month (capitalized) |
[nmon] |
Feb | Next month (short name) |
[pmonth] |
December | Previous month (full name) |
[cpmonth] |
December | Previous month (capitalized) |
[pmon] |
Dec | Previous month (short name) |
| Shortcode | Output | Description |
|---|---|---|
[date] |
January 12, 2026 | Today's full date |
[monthyear] |
January 2026 | Current month and year |
[nmonthyear] |
February 2026 | Next month and year |
[pmonthyear] |
December 2025 | Previous month and year |
| Shortcode | Output | Description |
|---|---|---|
[dt] |
12 | Day of month (1-31) |
[nd] |
13 | Tomorrow's day number |
[pd] |
11 | Yesterday's day number |
[weekday] |
Sunday | Day of week (full name) |
[wd] |
Sun | Day of week (short name) |
| Shortcode | Description |
|---|---|
[datepublished] |
Post publication date |
[datemodified] |
Post last modified date |
| Shortcode | Output | Description |
|---|---|---|
[blackfriday] |
November 27 | Black Friday date (auto-calculated) |
[cybermonday] |
November 30 | Cyber Monday date (auto-calculated) |
| Shortcode | Example | Description |
|---|---|---|
[daysuntil date="2026-12-25"] |
347 | Days until a specific date |
[dayssince date="2020-01-01"] |
2203 | Days since a specific date |
Calculate and display age from any date. Perfect for "years of experience", personal profiles, or anniversary tracking.
| Shortcode | Example Output | Description |
|---|---|---|
[age date="1990-05-15"] |
35 | Age in years only |
[age date="1990-05-15" ordinal="true"] |
35th | Age with ordinal suffix (st/nd/rd/th) |
[age date="1990-05-15" rank="true"] |
35th | Same as ordinal (alias) |
[age date="1990-05-15" format="ym"] |
35 years, 7 months | Years and months |
[age date="1990-05-15" format="ymd"] |
35 years, 7 months, 28 days | Full age breakdown |
Use cases:
- Display years of experience:
[age date="2010-06-01"]+ years of experience - Display ordinal anniversary:
Celebrating our [age date="2015-08-20" ordinal="true"] anniversary - Personal profiles:
Age: [age date="1990-05-15"] - Anniversary tracking:
Married for [age date="2015-08-20" format="ym"] - Ranking content:
My [age date="2020-01-01" rank="true"] year blogging
Display the current season with hemisphere support.
| Shortcode | Example Output | Description |
|---|---|---|
[season] |
Winter | Current season (Northern hemisphere) |
[season region="north"] |
Winter | Northern hemisphere (explicit) |
[season region="south"] |
Summer | Southern hemisphere (reversed) |
Season mapping:
- Northern hemisphere: Spring (Mar-May), Summer (Jun-Aug), Fall (Sep-Nov), Winter (Dec-Feb)
- Southern hemisphere: Seasons are reversed (Summer when North has Winter, etc.)
Use cases:
- Seasonal content:
[season] Sale - Shop Now! - Regional targeting:
Enjoy [season region="south"] in Australia - Dynamic promotions:
Get ready for [season] with our latest collection
A dedicated Gutenberg block for inserting dynamic dates with:
- Live preview in the editor
- All date types available via dropdown
- Custom format options
- Age calculation with format selection
- Typography and color controls
Display the post's publication date dynamically:
- Uses WordPress date format from Settings
- Custom date format support
- Typography and color controls
Display the post's last modified date dynamically:
- Uses WordPress date format from Settings
- Custom date format support
- Typography and color controls
Interactive countdown block powered by the WordPress Interactivity API:
- Live calendar-day countdown that stays correct when cached HTML crosses midnight
- Counts until or since a target date
- Optional annual recurrence, including February 29
- Correct singular and plural day labels
- Customizable target date
- Style options for colors and typography
A calendar icon in the Block Editor formatting toolbar provides quick access to all shortcodes:
- Organized by category (Year, Month, Date, Events, Countdown, Age)
- Shows usage examples for shortcodes with arguments
- Inserted shortcodes are highlighted with a subtle blue background for visibility
- One-click insertion into any text block
Seven theme-neutral patterns are available in the Block Inserter under "Dynamic Dates":
- Copyright Footer - Auto-updating copyright year
- Last Updated - Native Modified Date block with an editable prefix
- Current Month Heading - Current month and year in a heading
- Black Friday and Cyber Monday Dates - Compact event-date list
- 30-Day Countdown - Countdown set 30 days from insertion
- Recurring Birthday Countdown - Annual month-and-day countdown
- Recurring New Year Countdown - Annual January 1 countdown
For WordPress 6.5+, use Block Bindings to connect core blocks directly to dynamic date values:
<!-- wp:paragraph {"metadata":{"bindings":{"content":{"source":"dmyip/date","args":{"type":"year"}}}}} -->
<p></p>
<!-- /wp:paragraph -->Available binding types: year, month, date, monthyear, weekday, and more.
Access dynamic dates programmatically:
GET /wp-json/dmyip/v1/dates
GET /wp-json/dmyip/v1/shortcodes
GET /wp-json/dmyip/v1/date/year?offset=-3
GET /wp-json/dmyip/v1/render?shortcode=%5Byear%20n%3D-3%5D
# Render a shortcode
wp dmyip shortcode "[year]"
wp dmyip shortcode "[age date='1990-05-15' format='ym']"
# Or render a date type with named options
wp dmyip shortcode daysuntil --date=2027-01-01
# List all available shortcodes
wp dmyip list
# Test all shortcodes
wp dmyip test- Rank Math - Full support including OpenGraph and Schema
- Rank Math Pro - 100% compatible
- Yoast SEO - Full support including JSON-LD Schema
- Yoast SEO Premium - 100% compatible
- SEOPress / SEOPress Premium - Full support
- Gutenberg / Block Editor (native support)
- Elementor (100% support)
- WPBakery Page Builder
- Visual Composer
- Beaver Builder
- Brizy Builder
- Oxygen Builder
- Bricks Builder
Works with all major themes including Twenty Twenty-Five, Twenty Twenty-Four, Twenty Twenty-Three, Twenty Twenty-Two, Twenty Twenty-One, Twenty Twenty, Astra, Neve, Hello (Elementor), Kadence, GeneratePress, Blocksy, and OceanWP.
- Jetpack Related Posts
- Contextual Related Posts
- Intelly Related Posts (IRP)
- Advanced Custom Fields (see FAQ)
- Lightweight Accordion
- All popular Gutenberg block plugins (Greenshift, GenerateBlocks, Kadence Blocks, Spectra, Otter Blocks)
- Zero Configuration - Works out of the box, no settings needed
- Multi-language Support - WPML ready, renders in your site's language
- Performance Focused - Minimal CSS/JS, no database queries for shortcodes
- Cache Aware - The Live Countdown corrects cached day counts in the browser
- Privacy First - No analytics, no data collection
- Free Forever - No upsells, no premium version
- Modern Codebase - PSR-4 autoloading, namespaced classes, PHPStan/PHPCS validated
- Upload the plugin folder to
/wp-content/plugins/directory, or install through WordPress plugins screen - Activate the plugin through the 'Plugins' screen in WordPress
- Start using shortcodes in your content - no configuration required!
If you're an affiliate marketer or blogger who uses dates in your posts (e.g., "Best Products of 2026", "January Deals"), this plugin automatically updates those dates as time passes. No more manually updating old posts!
Use the [age] shortcode with a birth date:
[age date="1990-05-15"] → 35
[age date="1990-05-15" format="ym"] → 35 years, 7 months
[age date="1990-05-15" format="ymd"] → 35 years, 7 months, 28 days
<?php echo do_shortcode('[year]'); ?>
<?php echo do_shortcode('[age date="1990-05-15"]'); ?>Add this to your theme's functions.php or Code Snippets plugin:
// For text field type
add_filter('acf/format_value/type=text', 'do_shortcode');
// For a specific field name
add_filter('acf/format_value/name=headline', 'do_shortcode');Yes! Shortcodes work in both editors. In the Block Editor, you also get:
- A dedicated Dynamic Date block
- Toolbar button for quick insertion
- Visual highlighting of shortcodes
- Pre-built patterns
Yes. Date output uses WordPress's locale-aware wp_date() API and renders in your site's configured language.
Since 1.7.1, use the dmyip_core_filters filter to selectively disable shortcode processing:
// Disable all core filters (shortcodes only work in post content and blocks)
add_filter( 'dmyip_core_filters', '__return_empty_array' );
// Disable only title processing
add_filter( 'dmyip_core_filters', function ( $filters ) {
$filters['the_title'] = false;
return $filters;
} );Available keys: the_title, single_post_title, wp_title, the_excerpt, get_the_excerpt, get_the_archive_title. All default to true.
Minimal impact. Editor CSS and JavaScript load only in the editor. Frontend JavaScript loads only when a Live Countdown block is present. Shortcode rendering makes no plugin database queries. Because ordinary shortcodes are server-rendered, a full-page cache must expire or purge before a cached year, month, date, or age changes; the Live Countdown corrects its visible day count after the page loads.
- Copyright notices: Use
[year]in footer widgets - Affiliate content: "Best Products of [year]" or "Top Deals for [month] [year]"
- Time-sensitive content: "[month] Sale - Ends Soon!"
- Black Friday content: "Black Friday [year] starts [blackfriday]"
- Evergreen content: Keep "Updated for [year]" current automatically
- Experience/tenure: "[age date="2015-01-01"] years in business"
- Age display: "Age: [age date="1990-05-15" format="ym"]"
- Event countdowns: "Only [daysuntil date="2026-12-25"] days until Christmas!"
- Milestone tracking: "It's been [dayssince date="2020-03-15"] days since we launched"
This plugin:
- Does not collect any user data
- Does not use analytics or tracking
- Does not make external requests
- Does not store anything in the database
- Has no settings page or admin notices
- WordPress 6.5 or higher
- PHP 7.4 or higher
This free and open source WordPress plugin gives you shortcodes like [year], [monthyear] and [age] that keep dates, ages and countdowns current in your posts, titles and SEO meta. I keep adding shortcodes and plugin integrations and the current release is tested up to WordPress 7.1.
If the plugin keeps the year in your post titles current and you no longer edit them by hand every January, you can buy me a coffee.
A wrong date from any shortcode is worth an issue with your WordPress and PHP versions and the steps to reproduce it, and a GitHub star is appreciated as well.
- Fixed recurring February 29 countdowns so PHP and browser calculations agree.
- Invalid countdown dates no longer display as zero days; the default day label now uses singular and plural forms correctly.
- WP-CLI now accepts both complete plugin shortcodes and renderer types with named options.
- Added WordPress 7.1 compatibility, content-role metadata for blocks, dependency security updates, and wider runtime checks.
- Corrected the documented countdown, pattern, editor, cache, and CLI behavior.
- Added recurring, cache-aware countdowns with leap-day handling and Block Bindings presets.
- Made date calculations site-timezone and daylight-saving safe.
- Scoped title, excerpt, and supported-plugin processing to this plugin's shortcodes.
- Fixed the Countdown block's Interactivity API module build.
- Improved the searchable shortcode picker, editor accessibility, previews, patterns, automated tests, and release checks.
- Raised the minimum WordPress version to 6.5.
- Changed: Tested up to WordPress 7.0
- Fix:
[season]shortcode not working in legacy (non-Composer) installations - Fix:
[age]shortcode missingordinal/rankattributes in legacy installations - Fix: Duplicate Open Graph filter registrations in legacy Rank Math integration
- Fix: Duplicate Elementor and CRP filter registrations in legacy SEOPress file
- New: Published Date and Modified Date Gutenberg blocks
- New:
dmyip_core_filtersfilter to selectively disable shortcode processing on WordPress core filters (titles, excerpts, archive titles). Props @meteorlxy. - Fix:
[year]shortcode with large negative offsets (e.g.,[year n=-2003]) now returns correct results instead of wrong/empty values. - Fix:
[year]shortcode no longer zero-pads results (e.g.,[year n=-1100]returns926instead of0926).
- New:
[season]shortcode to display current season[season]- Northern hemisphere (default)[season region="south"]- Southern hemisphere
- New: Ordinal suffix support for
[age]shortcode[age date="1990-05-15" ordinal="true"]- Returns "35th"[age date="1990-05-15" rank="true"]- Alias for ordinal
- Improvement: Proper handling of special ordinals (11th, 12th, 13th)
- New:
[age]shortcode to calculate and display age from a birth date[age date="1990-05-15"]- Years only[age date="1990-05-15" format="ym"]- Years and months[age date="1990-05-15" format="ymd"]- Full age breakdown
- New: Dedicated Dynamic Date Gutenberg block with live preview
- New: Live Countdown block with Interactivity API (auto-updates at midnight)
- New: Block Bindings API support (WP 6.5+) for binding core blocks to dynamic dates
- New: REST API endpoints (
/wp-json/dmyip/v1/dates,/dmyip/v1/shortcodes) - New: WP-CLI commands (
wp dmyip shortcode,wp dmyip list,wp dmyip test) - New: 13 Block Patterns including Age Display Card, Birthday Countdown, Experience Badge, New Year Countdown, Days Since Milestone, and Promotional Banner with CTA
- New: Shortcodes inserted via toolbar are highlighted with orange background in editor
- New: Toolbar dropdown shows usage examples for shortcodes with arguments
- New: PHPStan and PHPCS configuration for code quality
- New: Modernized codebase with namespaced PHP classes (PSR-4 autoloading)
- New: CI/CD pipeline with automated testing
- Improvement: Requires WordPress 6.0+ and PHP 7.4+
- Fix: Block Editor toolbar using RichTextToolbarButton for proper formatting toolbar integration
- Fix: Block Editor toolbar button using proper BlockControls API
- Fix: Block Editor crash when opening options menu
- Fix: Block Editor toolbar button display and shortcode insertion
- New:
[daysuntil]and[dayssince]countdown shortcodes - New: Block Editor toolbar button for inserting shortcodes
- New: Dynamic Dates sidebar panel with shortcode reference
- New: 7 pre-built Block Patterns (Copyright Footer, Sale Banners, etc.)
- New: GitHub Actions workflow for automated releases
- More improvements (props @meteorlxy)
- Refactored code structure
- Fix for Rank Math SEO JSON and Excerpts
- New:
[nd]and[pd]for next and previous day numbers
- New:
[nmonthyear]and[pmonthyear]shortcodes
- Shortcode support in Archive Titles
- Dynamic Black Friday and Cyber Monday dates
- Year offset support:
[year n=5]for future years
- New:
[datemodified]and[datepublished]shortcodes
- Full Yoast SEO support
- Optimized code
- Complete SEOPress support
- New:
[blackfriday]and[cybermonday]shortcodes - Intelly Related Posts support
This plugin is licensed under the GPL v3 or later.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
See LICENSE for the full license text.
