Title: Echo Current Year
Last modified: February 5, 2024

---

# Echo Current Year

 *  [SoloAnt](https://wordpress.org/support/users/soloant/)
 * (@soloant)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/echo-current-year/)
 * How would I be able to use {echo:date(‘Y’)} in the message area so I’m not needing
   to remember to update the year when it rolls over?
 * Thank you

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Phil](https://wordpress.org/support/users/philsbury/)
 * (@philsbury)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/echo-current-year/#post-17400741)
 * Hi [@soloant](https://wordpress.org/support/users/soloant/), which field are 
   you doing it in? If it’s the Additional Content that allows shortcodes so you
   could create a super simple one like
 *     ```wp-block-code
       add_shortcode('year', fn() => date('Y'));
       ```
   
 * Then just add `[year]` to the box?
 * If it’s another field, that’ll need a bit more thought (from me!)
 * Thanks
   Phil
 *  Thread Starter [SoloAnt](https://wordpress.org/support/users/soloant/)
 * (@soloant)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/echo-current-year/#post-17400962)
 * Hi, yes, in the Additional Content area. Apologies for not being more specific
   there.
 * I want to add this “© {echo:date(‘Y’)} BrandNameHere. All Rights Reserved.” so
   when a new year rolls around I’m not having to go in and update the date within
   the age-gate additional content area, I’d like it to update automatically.
 * I tried adding that little snippet a couple of different ways to that area but
   it just returned the copy/pasted text so I’m not doing something right. See here
   [https://www.dropbox.com/scl/fi/mo2yxmt54458dfgfphq9m/CleanShot-2024-02-05-at-14.22.13-2x.png?rlkey=7ailhf4kn2o2xinjgza0ferzd&dl=0](https://www.dropbox.com/scl/fi/mo2yxmt54458dfgfphq9m/CleanShot-2024-02-05-at-14.22.13-2x.png?rlkey=7ailhf4kn2o2xinjgza0ferzd&dl=0)
 * Thanks,
 *  Plugin Author [Phil](https://wordpress.org/support/users/philsbury/)
 * (@philsbury)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/echo-current-year/#post-17403719)
 * So add this to your functions:
 * `add_shortcode('year', fn() => date('Y'));`
 * Of if you are on less that PHP 7.4 use:
 *     ```wp-block-code
       add_shortcode('year', function() {
           return date('Y');
       });
       ```
   
 * Then put `© [year] BrandNameHere. All Rights Reserved.` in the options box
 * Thanks
   Phil
 *  Thread Starter [SoloAnt](https://wordpress.org/support/users/soloant/)
 * (@soloant)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/echo-current-year/#post-17404095)
 * Aweee, thank you so much, got it working now.
 * Much appreciated. 👍

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Echo Current Year’ is closed to new replies.

 * ![](https://ps.w.org/age-gate/assets/icon-256x256.png?rev=2783003)
 * [Age Gate](https://wordpress.org/plugins/age-gate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/age-gate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/age-gate/)
 * [Active Topics](https://wordpress.org/support/plugin/age-gate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/age-gate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/age-gate/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [SoloAnt](https://wordpress.org/support/users/soloant/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/echo-current-year/#post-17404095)
 * Status: not resolved