WordPress: Auto Update Copyright Year

I use this snippet in the footer of my WordPress sites. The year automatically updates. So you never have to worry about changing it every year.

// Displays "© 2019"
© <?= date('Y') ?>

// Displays "© 2013-2019 MyCompanyName" <?php call_user_func(function($y){$c=date('Y');echo $y.(($y!=$c)?'-'.$c:'');}, 2013); ?> MyCompanyName.

Mitch Bartlett

I've been doing things on the Internet since 1994. Former dot-com era IT guy. Currently I provide technical solutions to people for fun and test software for a growing software company.

Leave a Reply

Your email address will not be published. Required fields are marked *