Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Copyright Current Year

[copyright] shortcode generates: Copyright © $year
with the ID #copyright so you can style it with CSS
using function php echo “Copyright ©” . date( ‘Y’ );

// Add Shortcode
function shortcode_copyright_year() {

	// This will output "Copyright © 2024" or the current year automatically.
	
	$copyright = "Copyright © " ;
	
	$current_year = date( 'Y' ) ; 
	
	$copyright_year = $copyright . $current_year ;
	
	echo <span id="copyright">$copyright_year;</span>
	
	// For centered text, replace line 9 with this: 
	// echo '<span id="copyright"><center>', $copyright_year, "</center></span>";
	// Now you can use CSS styling too. 

}
add_shortcode( 'copyright', 'shortcode_copyright_year' );