Title: Update year automatically
Last modified: December 25, 2021

---

# Update year automatically

 *  [droyed](https://wordpress.org/support/users/droyed/)
 * (@droyed)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/update-year-automatically/)
 * Hi there,
 * How do I insert a date field that reflects the current year without me having
   to manually change it for every block of text.
 * For instance, I want the bolded part below to be automatically updated based 
   on when users copy it
 * [copy text=”Copy Citation”]Author (2021). Post Title. Updated **CurrentYear**.[/
   copy]
 * And so, if the user copies the citation next in 2024, this will show:
 * Author (2021). Post Title. Updated 2024.
 * How do I achieve this?
 * Many thanks.

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

 *  [Jeroen Rotty](https://wordpress.org/support/users/jeroenrotty/)
 * (@jeroenrotty)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/update-year-automatically/#post-15279100)
 * If you can do PHP within your solution, you can just do
 * `<?PHP echo date("Y"); ?>`
    -  This reply was modified 4 years, 4 months ago by [Jeroen Rotty](https://wordpress.org/support/users/jeroenrotty/).
      Reason: fix typo
 *  Thread Starter [droyed](https://wordpress.org/support/users/droyed/)
 * (@droyed)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/update-year-automatically/#post-15279157)
 * Hi [@jeroenrotty](https://wordpress.org/support/users/jeroenrotty/)
 * Thanks again! But tbh, I wouldn’t have a clue where to insert this mate. Is there
   something I could stick into the Additional CSS space?
 *  [Jeroen Rotty](https://wordpress.org/support/users/jeroenrotty/)
 * (@jeroenrotty)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/update-year-automatically/#post-15279185)
 * No, PHP code can’t reside in CSS fields. Sorry that I did not see that this was
   posted in a plugin forum, thought you were generally asking how to implement 
   an auto-updating year :-).
 * You might want to enhance or fork this plugin shortcode so this can be included
   as a parameter, or wait until the plugin developer replies to this topic here.
 *  Thread Starter [droyed](https://wordpress.org/support/users/droyed/)
 * (@droyed)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/update-year-automatically/#post-15280328)
 * Hi [@jeroenrotty](https://wordpress.org/support/users/jeroenrotty/)
 * Thanks again for your response.
 * Actually, you’re right about both of these – I was generally looking for ways
   to re-use/auto-update blocks, but was also looking for answer to this specific
   plugin-related query.
 * Yes, I will wait for the plugins devs to provide an answer….hopefully soon.

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

The topic ‘Update year automatically’ is closed to new replies.

 * ![](https://ps.w.org/copy-the-code/assets/icon-256x256.png?rev=3451645)
 * [Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code](https://wordpress.org/plugins/copy-the-code/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/copy-the-code/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/copy-the-code/)
 * [Active Topics](https://wordpress.org/support/plugin/copy-the-code/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/copy-the-code/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/copy-the-code/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [droyed](https://wordpress.org/support/users/droyed/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/update-year-automatically/#post-15280328)
 * Status: not resolved