Add [year] and [copyright] shortcodes so your footer's copyright year updates itself every January.
// [year] → 2026
add_shortcode( 'year', function (): string {
return wp_date( 'Y' );
} );
// [copyright] → © 2026 Site Name
// [copyright from="2019"] → © 2019–2026 Site Name
add_shortcode( 'copyright', function ( $atts ): string {
$atts = shortcode_atts( [ 'from' => '' ], $atts, 'copyright' );
$now = wp_date( 'Y' );
$from = absint( $atts['from'] );
$span = ( $from && $from < (int) $now ) ? $from . '–' . $now : $now;
return esc_html( '© ' . $span . ' ' . wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) );
} );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
Footers that say “© 2023” in 2026 make a site look abandoned. These shortcodes print the current year, or a full copyright line, wherever you put them.
[year] returns the current year in your site’s timezone using wp_date(). [copyright] builds a full line with the © symbol and your site title, and can show a starting year with from="2019".
Shortcodes work in posts, the Shortcode block, most page builders’ text elements and classic text widgets.
Add [copyright from="2019"] to your footer. It should show “© 2019–2026 Your Site”.