I was updating my WordPress sites and noticed the copyright year on all my footers were still 2023... I thought they were supposed to automatically update lol. 

I didn't want to install another plug-in so I searched around for the easiest manual solution... and found it here!

Here's all I had to do:

1. Copy the following code to the very bottom of my functions.php file... I made certain not to change anything or add spaces anywhere:

function year_shortcode() { 
$year = date('Y'); 
return $year; 
}
add_shortcode('copyrightyear', 'year_shortcode');

2. Add the shortcode: [copyrightyear] (yes, including the brackets) to my footer where I want it to appear.

3. Save!

I updated all my websites so the copyright in my footer should update each year!

carmen sakurai

I’m a single-momma, certified trauma-informed life coach specializing in narcissistic abuse recovery, religion teacher, best selling author, foodie wannabe, and advocate for victims of narcissistic abuse.

Currently living la vida loca in Vegas with my favorite human… while pseudo-adulting, Tahitian dancing, and mmm bubble tea!

category:

tags:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>