# Elementor Dynamic Tag: Current Year

> Adds a "Current Year" dynamic tag to Elementor Pro so copyright lines and headings update themselves every January.

- Type: PHP
- Runs: Run everywhere
- Category: [Page Builders & Themes](https://wpide.com/library/category/page-builders/)
- Tags: elementor, dynamic-tags, date
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/elementor-dynamic-tag-current-year/

## Code

```php
add_action( 'elementor/dynamic_tags/register', function ( $dynamic_tags ) {
    if ( ! class_exists( '\Elementor\Core\DynamicTags\Tag' ) || ! class_exists( '\Elementor\Modules\DynamicTags\Module' ) ) {
        return;
    }

    if ( ! class_exists( 'WPIDE_Elementor_Year_Tag' ) ) {
        class WPIDE_Elementor_Year_Tag extends \Elementor\Core\DynamicTags\Tag {
            public function get_name() {
                return 'wpide-current-year';
            }

            public function get_title() {
                return 'Current Year';
            }

            public function get_group() {
                return 'wpide-site';
            }

            public function get_categories() {
                return array( \Elementor\Modules\DynamicTags\Module::TEXT_CATEGORY );
            }

            public function render() {
                echo esc_html( wp_date( 'Y' ) );
            }
        }
    }

    $dynamic_tags->register_group( 'wpide-site', array( 'title' => 'Site Details' ) );
    $dynamic_tags->register( new WPIDE_Elementor_Year_Tag() );
} );
```

## Notes

Dynamic tags need Elementor Pro. Find the tag under "Site Details" in the dynamic tags list.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Elementor Dynamic Tag: Current Year" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
